Can't access docker registry behind traefik 2.0
Summary
I have set up a Gitlab with the omnibus docker image and the image is exposed by traefik 2.0. I can access Git properly with https but can't get access on the registry
Steps to reproduce
Create a docker-compose.yml file :
gitlab:
image: 'gitlab/gitlab-ce:latest'
container_name: hlx-gitlab
hostname: '${HX_GITLAB_HOSTNAME}'
env_file:
- .env
volumes:
- ${HX_GITLAB_CONFIG}:/etc/gitlab:rw
- ${HX_GITLAB_LOGS}:/var/log/gitlab:rw
- ${HX_GITLAB_DATA}:/var/opt/gitlab:rw
environment:
TZ: ${HX_TIMEZONE}
GITLAB_OMNIBUS_CONFIG: |
external_url "https://${HX_GITLAB_HOSTNAME}"
gitlab_rails['gitlab_ssh_host'] = "${HX_GITLAB_HOSTNAME}"
gitlab_rails['time_zone'] = '${HX_TIMEZONE}'
# Nginx params to redirect from traefik
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
letsencrypt['enable'] = false
# DATABASE CONNECTION SETTINGS: in our case we use postgresql as database
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_database'] = "${HX_DB_NAME}"
gitlab_rails['db_host'] = "${HX_DB_CONTAINER_NAME}"
gitlab_rails['db_username'] = "${HX_DB_USER}"
gitlab_rails['db_password'] = "${HX_DB_PASSWORD}"
gitlab_rails['db_encoding'] = "utf8"
postgres_exporter['env']['DATA_SOURCE_NAME'] = "user=${HX_DB_USER} password=${HX_DB_PASSWORD} host=${HX_DB_CONTAINER_NAME} database=${HX_DB_NAME} sslmode=disable"
postgres_exporter['password'] = "${HX_DB_PASSWORD}"
# SMTP Conf
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "${HX_SMTP_HOSTNAME}"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "${HX_SMTP_USERNAME}"
gitlab_rails['smtp_password'] = "${HX_SMTP_PW}"
gitlab_rails['smtp_domain'] = "${HX_SMTP_HOSTNAME}"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = "${HX_EMAIL_FROM}"
gitlab_rails['gitlab_email_reply_to'] = "${HX_SMTP_USERNAME}"
# REDIS
redis['enable'] = false
gitlab_rails['redis_host'] = '${HX_REDIS_CONTAINER_NAME}'
gitlab_rails['redis_port'] = '6379'
# GITLAB DOCKER IMAGE REGISTRY: so that we can use our docker image registry with gitlab
registry_external_url 'https://${HX_REG_HOST}'
gitlab_rails['registry_enabled'] = true
gitlab_rails['api_url'] = 'https://${HX_REG_HOST}'
registry['enable'] = true
registry_nginx['enable'] = false
labels:
- "traefik.http.routers.gitlab.rule=Host(`${HX_GITLAB_HOSTNAME}`)"
- "traefik.http.routers.gitlab.tls.certresolver=le"
- "traefik.http.routers.gitlab.entrypoints=websecure"
- "traefik.http.routers.gitlab.service=gitlab"
- "traefik.http.services.gitlab.loadbalancer.server.port=80"
# registry
- "traefik.http.routers.gitlab-registry.rule=Host(`${HX_REG_HOST}`)"
- "traefik.http.routers.gitlab-registry.tls.certresolver=le"
- "traefik.http.routers.gitlab-registry.entrypoints=websecure"
- "traefik.http.routers.gitlab-registry.service=gitlab-registry"
- "traefik.http.services.gitlab-registry.loadbalancer.server.port=5555"
ports:
# the mapped port must match ssh_port specified above.
- "22:22"
networks:
- proxy
- gitlab_db_net
- gitlab_redis_net
restart: unless-stopped
What is the current bug behavior?
When attempting to docker login, the registry URL returns 502 bad gateway
What is the expected correct behavior?
A successful docker login
Relevant logs
I never found any relevant logs to this error
Details of package version
Provide the package version installation details
Name Version Architecture Description +++-=============================================-===========================-===========================-================================================================================================ ii gitlab-ce 13.0.6-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, Redis) un gitlab-ee (no description available)
Environment details
- Operating System:
Ubuntu 20.04
- Installation Target, remove incorrect values:
- Docker container on a VPS at OVH
- Installation Type, remove incorrect values:
- New Installation
- Is there any other software running on the machine: Not on the docker container
- Is this a single or multiple node installation? Single
- Resources
- CPU:
2 v-cores
- Memory total:
4Go
- CPU:
Configuration details
The configuration can be found in the docker-compose file above