When I try to log into my gitlab’s docker registry, it fails. Same for the push. I have gitlab running in a docker container. The registry is bound to port 5005.
Trying to log in via gitlab.myHostname.com:5005 fails. The same with :443 and :80. Trying to log in via gitlab.myHostname.com succeeds. Yet pushing fails always.
When I am not pushing to port 5005, every connection goes through a separate nginx, that is distinct from the nginx that runs in the gitlab docker container.
Here is my gitlab.rb:
gitlab_rails['gitlab_shell_ssh_port'] = 31422
registry_external_url 'https://gitlab.myDomain.com'
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "https://gitlab.myDomain.com:5005"
gitlab_rails['registry_port'] = "5005"
nginx['client_max_body_size'] = '4G'
nginx['redirect_http_to_https'] = false
nginx['listen_port'] = 443
nginx['listen_https'] = true
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/letsencrypt.pem"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/letsencrypt.key"
And here is my docker-compose for gitlab:
version: '3.7'
services:
gitlab:
networks:
default:
aliases:
- gitlab.docker
image: 'gitlab/gitlab-ce:12.8.0-ce.0'
restart: always
hostname: 'gitlab.myDomain.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.myDomain.com'
ports:
- '31422:22'
- '5005:5005'
volumes:
- '/etc/gitlab:/etc/gitlab'
- '/var/log/gitlab:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
- '/etc/letsencrypt/live/gitlab.myDomain.com/fullchain.pem:/etc/gitlab/ssl/letsencrypt.pem'
- '/etc/letsencrypt/live/gitlab.myDomain.com/privkey.pem:/etc/gitlab/ssl/letsencrypt.key'
labels:
- 'com.dnsdock.alias=gitlab.docker'
networks:
default:
external:
name: myDomain0
And finally, here is the error message I receive on push:
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://gitlab.myDomain.com:5005/v2/: dial tcp 0.0.0.0:5005: (EDIT: ip changed for privacy) connect: connection refused
The push refers to repository [gitlab.myDomain.com:5005/docker/sbt]
Get https://gitlab.myDomain.com:5005/v2/: dial tcp 0.0.0.0:5005: (EDIT: ip changed for privacy) connect: connection refused
Anyone any idea how to deal with it?