Problem login to registry. Get "https://registry.example:443/v2/": unavailable: registry not enabled

  • GitLab (Hint: /help): 13.12.1
  • Runner (Hint: /admin/runners): 14.5.2
  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)
stages:
    - build
    - staging
    - release


variables:
  TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
  REGISTRY: registry.example.com:443


before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY

# This file is a template, and might need editing before it works on your project.
docker-build-master:
  # Official docker image.
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - echo "$CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $REGISTRY" 
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $REGISTRY
  script:
    - docker build --pull -t "$TEST_IMAGE" -f docker/Dockerfile .
    - docker push "$TEST_IMAGE"
#  only:
#    - master
#  when:
#    - manual
  tags:
     - sysadm_test

release-image:
  stage: release
  script:
    - docker pull $TEST_IMAGE
    - docker tag $TEST_IMAGE $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
  only:
    - master
  when: manual
version: '3'
services:
   registry:
     image: registry:2
     container_name: registry
     restart: always
     network_mode: bridge
     volumes:
       - "./certs:/certs:ro"
       - "./data:/registry"
     environment:
       REGISTRY_LOG_LEVEL: debug
       REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry
       REGISTRY_HTTP_SECRET: *****
       REGISTRY_AUTH: token
       REGISTRY_AUTH_TOKEN_REALM: https://git.example.com/jwt/auth
       REGISTRY_AUTH_TOKEN_SERVICE: container_registry
       REGISTRY_AUTH_TOKEN_ISSUER: omnibus-gitlab-issuer
       REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: /certs/gitlab-registry.crt
       REGISTRY_STORAGE_DELETE_ENABLED: 'true'
       VIRTUAL_HOST: registry.example.com
       VIRTUAL_PORT: 5000
   nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    network_mode: bridge
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:8888:8888"
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "./certs:/etc/nginx/certs:ro"
      - "./nginx/conf.d/vhost.d:/etc/nginx/vhost.d"
      - "./nginx/conf.d/custom.conf:/etc/nginx/conf.d/custom.conf:ro"
      - "./nginx/www_data:/usr/share/nginx/html"
      - "./nginx/conf.d:/etc/nginx/conf.d:rw"
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
    environment:
      - DEFAULT_HOST=registry.example.com

gitlab.rb

# registry_external_url 'https://registry.example.com:443'
# gitlab_rails['registry_enabled'] = true
# gitlab_rails['registry_api_url'] = "https://registry.example.com" 
# gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
# gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"

can me help?