Gitlab CI cannot pull image from private docker registry

Current Gitlab and Gitlab Runners support this, see: https://docs.gitlab.com/runner/configuration/advanced-configuration.html#use-a-private-container-registry

On older Gitlab I've solved this with copying an auth key into ~/.docker/config.json

{
        "auths": {
                "my.docker.registry.url": {
                        "auth": "dmlsbW9zLm5hZ3k6VGZWNTM2WmhC"
                }
        }
}

I've logged into this container from my computer and copied this auth key into the Gitlab Runner's docker container.


What version of docker do you run on Gitlab ? Also for a v2 registry, you have to explicitly allow insecure registry with a command line switch, or secure your registry using a certificate.

Otherwise Docker fallback to the v1 registry if it gets a security exception.