GitLab-Runner with DOCKER_AUTH_CONFIG

Hello,

I have a .gitlab-ci.yml witch linked to a private Repository.

.gitlab-ci.yml:

image: privateReposURL:PORT/Image:TAG

I add a new secrect variable “DOCKER_AUTH_CONFIG” in GitLab with the content of my ~/.docker/config.json

{
“auths”: {
registry.example.com”: {
“auth”: “bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ=”
}
}
}

It runs very good but I see if I changed the auth-Key or I used the Image in a other Project “DOCKER_AUTH_CONFIG” is not longer required. If I delete the secret Variable I can use the Image all the time. But if I deleted the Docker Repos on my Server with

docker rmi imagename:tag

then I become the error that a username & password is required.

First I think the gitlab-Runner use the content of ~/.docker/config.json but the file has not content (deleted by me).
Why did’t the GitLab-Runner after the first run not need the DOCKER_AUTH_CONFIG anymore?

GitLab EE 9.4.1
Runner 9.3.0

Hi, this is expected behaviour, as your runner only pulls the image once and then doesn’t contact the registry again - at least as long as the image is still available locally.
When you use that image in a separate project, it uses the local copy of the image.
When you delete the local image, it asks for your credentials again, because it needs to pull it from the registry again.
That’s how Docker works =)

Thank You