I have GitLab server and a separate docker-registry. I have created a testuser with a testpassword.

My .gitlab-ci.yml

image: docker:latest
  - docker:18.09.7-dind
  DOCKER_HOST: tcp://docker:2375/
  DOCKER_DRIVER: overlay2
    # See https://github.com/docker-library/docker/pull/166
  REGISTRY: myregistry:5000/golang-test

  - build
 # - test
  - docker login -u testuser -p testpassword  myregistry:5000

    stage: build
      - docker-ci
      - docker ps
      - docker build -t $REGISTRY .
      - docker push $REGISTRY

When CI pipeline runs, I get following error.

WARNING! Using --password via the CLI is insecure. Use --password-stdin. Error response from daemon: Get https://myregistry:5000/v2/: dial tcp: lookup worker1 on no such host ERROR: Job failed: exit code 1

concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "docker-ci"
  url = "https://gitlab.sample.com:8000/"
  token = "89MfxRTby83ny3eTkTf2"
  tls-ca-file = "/etc/gitlab-runner/certs/gitlab.sample.com.crt"
  executor = "docker"
  pre_build_script = "export DOCKER_HOST=tcp://docker:2375"
    tls_verify = false
    image = "ubuntu:18.04"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

This was after suggested modifications here.

I can successfully login to my docker-registry using docker login -u testuser -p testpassword https://myregistry:5000 from gitlab running server.

1 Answer 1


Are you sure that your registry is publicly available? Checklist:

  • Check if the domain is reachable and responding the right IP address -- nslookup myregistry
  • Check if your port is open or not blocked any kind of software (let's say via firewalls or AWS security group) -- telnet myregistry 5050
  • Check if your registry is not restricted for a particular CIDR of IP
  • Test your login locally and ensure that there is no problem with it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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