I am trying to set up a gitlab runner service using a private Docker registry. According to the documentation it is sufficient to set the DOCKER_AUTH_CONFIG environment variable and populate it with the docker auth credentials:

concurrent = 2 check_interval = 0

  session_timeout = 1800

  name = "docker-shared-2"
  url = "https://gitlab.easybell.de/"
  token = "SDRWmUtpfVNb4c4xMicf"
  executor = "docker"
  environment = ["DOCKER_AUTH_CONFIG={ \"auths\": { \"xxxx\": { \"auth\": \"xxxx=\" } } }"]
    tls_verify = false
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

With this configuration, gitlab ci jobs still fail with the following error:

ERROR: Preparation failed: Error response from daemon: Get https://xxx: no basic auth credentials (executor_docker.go:168:0s)

What am I missing or need to to in addition to make this setup work?

  • It should work this way. Did you restart the gitlab-runner? – michael.kebe Aug 14 '19 at 5:43
  • did you manage to figure out the issue? – pymkin Sep 15 '19 at 10:58
  • Thanks for bumping the question, I added an answer. – Daniel Becker Sep 16 '19 at 12:29

Instead of setting the DOCKER_AUTH_CONFIG variable in the gitlab runner config it needs to be set for the docker daemon:


  "auths": {
      "my.private.registry": {
        "auth": "xx=="
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.