Gitlab Registry Service Unavailable from CI

Using GitLab Community Edition 9.5.4 fbffc27 on CentOS 7

When I try to do a docker login from the CI, I get the following error:

$ echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
Error response from daemon: Get https://******/v2/: Service Unavailable
ERROR: Job failed: exit code 1

  • Doing a docker login from command line works fine.

  • Opening the registry URL in a browser gives
    {“errors”:[{“code”:“UNAUTHORIZED”,“message”:“authentication required”,“detail”:null}]}
    which is also fine

  • Nothing about the login attempt from CI makes it to the logs

  • In gitlab.rb only the following registry options are enabled:
    registry_external_url ‘https://***’
    gitlab_rails[‘registry_enabled’] = true