gitlab container registry: how to test that it's set up and working?
I'm trying to push for the first time to a gitlab project container registry. I am not a gitlab administrator so I can't change global settings. But as far as my project is concerned I've made sure that I have a personal access token created for the project.
When I try to run my pipeline, it fails with a 404 error. I've recreated the steps just on the commandline to simplify things. here's what the output looks like:
PS /Users/me/src/pipelinetests> docker login -u widgetsProjectAccessToken -p asdf mygitserver.org/myusername/pipelinetests
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
PS /Users/me/src/pipelinetests> docker build -t mygitserver.org/myusername/pipelinetests:widgetsimage .
[+] Building 190.4s (12/12) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:6.0.202-bullseye-slim-amd64 0.2s
=> [internal] load build context 0.0s
=> => transferring context: 21.82kB 0.0s
=> [1/7] FROM mcr.microsoft.com/dotnet/sdk:6.0.202-bullseye-slim-amd64@sha256:1ee95620598b9afa3046d356bb7f7863e1602075dd407c790c34d0a9833acc73 0.0s
=> => resolve mcr.microsoft.com/dotnet/sdk:6.0.202-bullseye-slim-amd64@sha256:1ee95620598b9afa3046d356bb7f7863e1602075dd407c790c34d0a9833acc73 0.0s
=> CACHED [2/7] RUN apt update && apt-get install vim -y 0.0s
=> [3/7] COPY . /builds 0.1s
=> [4/7] RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash 93.2s
=> [5/7] RUN apt-get install curl && curl -sL https://deb.nodesource.com/setup_12.x | bash - 25.7s
=> [6/7] RUN apt-get install nodejs 13.0s
=> [7/7] RUN npm install -g azure-functions-core-tools@4 --unsafe-perm true 48.4s
=> exporting to image 9.7s
=> => exporting layers 9.6s
=> => writing image sha256:2f30a1f69f875df9e4645bea95247e7f8678da89d2da04524d0fc570e3e1ce4e 0.0s
=> => naming to mygitserver.org/myusername/pipelinetests:widgetsimage 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
PS /Users/me/src/pipelinetests> docker push mygitserver.org/myusername/pipelinetests:widgetsimage
The push refers to repository [mygitserver.org/myusername/pipelinetests]
\n 404\n\n <div class="container">\n
The page could not be found or you don't have permission to view it.\n
The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it.\n
Make sure the address is correct and that the page hasn't moved.\n
What I've Done so far
I've made sure that my project visibility and the settings are correct:
I've also created the personal access token - which the successful login proves.
In googling, it seems that some people found their container registry wasn't actually set up properly. I'm not sure how to test that if I'm not a global admin.
So my first question is do you know of any other way I can test to make sure that it's a config issue?
If we assume it's actually set up correctly, could it just be that I haven't specified the correct port in my push command? Like if the admin chose a non standard port, could that be the issue?
Are there other trees I should be barking up?
These are the options under Packages & Registries
Laycee last edited by
It looks to me like you're not pushing to the right port.
When you go to the project space, and then go to your container registry
/container_registry(or click under Packages & Registries → Container Registry
Or, like this if you prefer to click on Packages & Registries
On this page you should see a bunch of links, one of them should have something like this,
docker push domain:5050/myusername/pipelinetests
You want to be sure you're including that
:5050. That's the defualt port for the https://docs.gitlab.com/ee/administration/packages/container_registry.html . It looks like from that error, that you're targeting the actual project page.