Gitlab-ci dind build can´t login to (insecure) Registry after upgrade from 11.x to 12.1

Hello all,

We upgraded our gitlab from v11 to v12.1 (gitlab and gitlab runner in docker).
Now the ci-pipeline with gitlab-ci failed with error while docker login to the GitLab Docker Registry.

The GitLab CI-Registry is a local IP-Address 192.168… without certificates (insecure)
We changed nothing else than the GitLab version

$ docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
time="2019-07-24T15:01:40Z" level=info msg="Error logging in to v2 endpoint, trying next endpoint: Get http: server gave HTTP response to HTTPS client"
Get http: server gave HTTP response to HTTPS client


  • gitlab/gitlab-runner:alpine-v12.1.0
  • gitlab/gitlab-ce:12.1.0-ce.0
  • Docker version 18.09.0, build 4d60db4

runner config:

concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "docker in docker build"
  url = ""
  token = "xxxxxxxxxxxxxxxxxxxxx"
  executor = "docker"
    tls_verify = false
    image = "docker:dind"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    run_exec = ""

and in the .gitlab-ci.yml:

  - name: docker:dind

–> solved

I setup a complete new configuration (runners and gitlab-ci.yml) like described under

Hello, How did you solved it? Suddenly all my CI stopped working by failing with this same error

My solution was to setup the configuration completly new, how discribed under the link above

added the following variable to my gitlab-ci.yml:


It is imortend to use docker login <insecure registry> inside the script-section and NOT in before_script-section!

–> I think the AND-solution only can solve your problem