4

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_server]
  session_timeout = 1800

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

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?

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

1 Answer 1

2

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

/etc/docker/config.json

{
  "auths": {
      "my.private.registry": {
        "auth": "xx=="
      }
  }
}  

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .