Search code examples
dockergitlabgitlab-cidocker-registrycontainer-registry

GitLab Container Registry Connection Error


I have a GitLab installation running on Docker (Windows 10 Docker-Desktop). I made GitLab Container Registry settings. When I try to connect to the Container Registry, I get the following connection refused error;

 No connection could be made because the target machine actively refused it.

Could you help to solve the problem? Thank you.

Docker login command I run via PowerShell;

docker login https://10.41.74.50:5005 -u root -p glpat-KUYeCWmUBJLCbKAdXEec

All Error Result;

Error response from daemon: Get "https://10.41.74.50:5005/v2/": dialing 10.41.74.50:5005
with direct connection: connecting to 10.41.74.50:5005: dial tcp 10.41.74.50:5005:
connectex: No connection could be made because the target machine actively refused it.

The environment settings of GitLab inside gitlab.rb are as follows;

## GitLab URL
external_url 'https://10.41.74.50'

################################################################################
## Container Registry settings
##! Docs: https://docs.gitlab.com/ee/administration/packages/container_registry.html
################################################################################

registry_external_url 'https://10.41.74.50:5005'

### Settings used by GitLab application
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "10.41.74.50"
gitlab_rails['registry_port'] = "5005"

### Settings used by Registry application
registry['enable'] = true

################################################################################
## GitLab NGINX
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html
################################################################################

nginx['enable'] = true
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/10.41.74.50.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/10.41.74.50.key"

################################################################################
# Let's Encrypt integration
################################################################################
letsencrypt['enable'] = false

docker-compose.yml;

version: '3.7'

services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    restart: always
    hostname: '10.41.74.50'
    container_name: gitlab-latest-test
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - D:/T_gitlab_volume/etc/gitlab:/etc/gitlab
      - D:/T_gitlab_volume/var/log/gitlab:/var/log/gitlab
      - D:/T_gitlab_volume/var/opt/gitlab:/var/opt/gitlab
      - D:/T_gitlab_volume/var/opt/gitlab/backups:/var/opt/gitlab/backups

Docker environment;

Docker version 24.0.2, build cb74dfc
Docker Compose version v2.19.1
Docker-Desktop version 4.22.1

GitLab Container Registry Web Page;

enter image description here


Solution

  • I just forgot to add port 5005 to docker-compose.yml. I noticed that when I rechecked the post.

    docker-compose.yml:

    version: '3.7'
    
    services:
      gitlab:
        image: gitlab/gitlab-ce:latest
        restart: always
        hostname: '10.41.74.50'
        container_name: gitlab-latest-test
        ports:
          - '80:80'
          - '443:443'
          - '22:22'
          - '5005:5005'
        volumes:
          - D:/T_gitlab_volume/etc/gitlab:/etc/gitlab
          - D:/T_gitlab_volume/var/log/gitlab:/var/log/gitlab
          - D:/T_gitlab_volume/var/opt/gitlab:/var/opt/gitlab
          - D:/T_gitlab_volume/var/opt/gitlab/backups:/var/opt/gitlab/backups