Error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 169.254.169.254:53: no such host

Hello, yesterday we start to get this error during publish
error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 169.254.169.254:53: no such host
Can you help me ?

2 Likes

See Docker:dind stops working after 12.1.0 update

You might also want to use this approach instead: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding

1 Like

Hi everyone! I want to share the solution!

just add image = docker:stable and privileged = true

and that’s all! enjoy!

7 Likes

I was having this issue and I follow the suggestion of @a.mashukov, now I’m getting a similar message but in the build stage.

my .gitlab-ci.yml:
# Official docker image.

image: docker:latest

services:

  - docker:dind

before_script:

  - echo "$CI_REGISTRY"

  - echo "$CI_REGISTRY_USER"

  - echo "$CI_REGISTRY_PASSWORD"

  - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin

Building image:

  stage: build

  tags:

    - build

    - docker

    - test

  script:

    - docker build --pull -t "$CI_REGISTRY_IMAGE"/my-image .

only:
  - master

And the output of the job:

`Checking out 2d606f0a as master...` `Skipping Git submodules setup ` `$ echo "$CI_REGISTRY"  ` `registry.gitlab.com` `$ echo "$CI_REGISTRY_USER"` `gitlab-ci-token` `$ echo "$CI_REGISTRY_PASSWORD"` `[MASKED]` `$ echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin` `WARNING! Your password will be stored unencrypted in /root/.docker/config.json.` `Configure a credential helper to remove this warning. See` `https://docs.docker.com/engine/reference/commandline/login/#credentials-store` `Login Succeeded` `$ echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin` `WARNING! Your password will be stored unencrypted in /root/.docker/config.json.` `Configure a credential helper to remove this warning. See` `https://docs.docker.com/engine/reference/commandline/login/#credentials-store` `Login Succeeded` `$ docker build --pull -t "$CI_REGISTRY_IMAGE"/staging/aruba-autos.com --build-arg DB_ROOT_PASSWORD=xt-d3f4ultp455w0rd --build-arg DB_NAME=aruba-autos.com --build-arg DOMAIN=staging.aruba-autos.com --build-arg THEME_REPOSITORY=git@gitlab.com:xenotrue/development/osclass_them_xt-curacaoproperties.git --build-arg SITE_ROOT_EXTRAS=git@gitlab.com:xenotrue/infrastructure/xt-web-solution-backups/curacao-properties.com/curacao-properties.com_site-root_extras.git --build-arg THEME_IMAGES=git@gitlab.com:xenotrue/infrastructure/xt-web-solution-backups/curacao-properties.com/curacao-properties.com_them_imag_uploads.git --build-arg UPLOADS_REPOSITORY=git@gitlab.com:xenotrue/infrastructure/xt-web-solution-backups/curacao-properties.com/curacao-properties.com_oc-content_uploads.git --build-arg PLUGIN_BANNERS=git@gitlab.com:xenotrue/development/osclass_plug_xt-banners.git --build-arg BANNERS_IMAGES=git@gitlab.com:xenotrue/infrastructure/xt-web-solution-backups/curacao-autos.com/curacao-autos.com_plug_bann_banners.git --build-arg PLUGIN_PACKAGES=git@gitlab.com:xenotrue/development/osclass_plug_xt-packages.git --build-arg PLUGIN_SOCIAL=git@gitlab.com:xenotrue/development/osclass_plug_social-bookmarks.git --build-arg PLUGIN_YOUTUBE=git@gitlab.com:xenotrue/development/osclass_plug_youtube.git --build-arg PLUGIN_PAYPRO=git@gitlab.com:xenotrue/development/osclas_payments-pro.git --build-arg INFRASTRUCTURE_SSH_PRIVATE_KEY="$INFRASTRUCTURE_SSH_PRIVATE_KEY" .` `Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?` `ERROR: Job failed: exit code 1`

Any help?

JUNE 2021: this worked for me:
stage: release
image: docker:latest
services:
- docker:18.09.7-dind
variables:
DOCKER_HOST: tcp://localhost:2375/

You might need to add --docker-network-mode "host" to the Gitlab runner config. Before doing that I got the following error (assuming “dind” is the hostname, not “docker”):

ERROR: error during connect: Get http://dind:2375/v1.40/info: dial tcp: lookup dind on 8.8.8.8:53: no such host

edit config.toml and change volumes option

before

[[runners]]
  ...
  [runners.docker]
    volumes = ["/cache"]
    ...

after

[[runners]]
  ...
  [runners.docker]
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
    ...

issue