How do I setup an insecure GitLab Container Registry on an instance of the GitLab Omnibus Docker Container?


Maybe I’m doing the setup wrong, but I can’t seem to get the container registry to work. For some background, my GitLab server is not outward facing at all, but I’m hoping to make use of the container registry.

I guess to start, this is my docker-compose setup:

version: '3.7'

        image: 'gitlab/gitlab-ce:latest'
        restart: always
        hostname: ''
                external_url ''
                registry_external_url ''
                # Add any other gitlab.rb configuration here, each on its own line
                gitlab_rails['smtp_enable'] = true
                gitlab_rails['smtp_address'] = ""
                gitlab_rails['smtp_port'] = 587
                gitlab_rails['smtp_user_name'] = ""
                gitlab_rails['smtp_password'] = "password"
                gitlab_rails['smtp_domain'] = ""
                gitlab_rails['smtp_authentication'] = "login"
                gitlab_rails['smtp_enable_starttls_auto'] = true
                gitlab_rails['smtp_tls'] = false
                gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
                gitlab_rails['gitlab_email_from'] = ''
                gitlab_rails['gitlab_email_reply_to'] = ''
            - '80:80'
            - '443:443'
            - '22:22'
            - '5000:5000'
            - '/docker/gitlab/config:/etc/gitlab'
            - '/docker/gitlab/logs:/var/log/gitlab'
            - '/docker/gitlab/data:/var/opt/gitlab'
            - '/docker/registry:/var/opt/gitlab/gitlab-rails/shared/registry'
            - externalDockerBridgeNetwork

        external: true

According to this:
I only needed to configure a domain name as per instructions here:
from there, of the two methods it offered, the method I chose was:
and I added this line registry_external_url '' to my docker-compose file under environment. I did not add the other two lines pertaining to the certificates because I planned to setup an insecure registry, and do not have a certificate.
I also got the volume in the docker-compose file: /docker/registry:/var/opt/gitlab/gitlab-rails/shared/registry from here:
I restarted with docker-compose down and docker-compose up -d afterwards.

Then, I followed this link:
and created a file named /etc/docker/daemon.json on my client machine and put this in it:

  "insecure-registries" : [""]

from there, I restarted my daemon with sudo systemctl restart docker and tried docker login
but I get this error: Error response from daemon: login attempt to failed with status: 400 Bad Request

What am I doing wrong?

I get the sneaking suspicion that I’ve followed instructions to enable the feature on GitLab, but literally did nothing to setup and start a registry

1 Like

@weilun I am also in the same scenario and facing same issue. Did you find any solution for this?