Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab Runner Docker login not working error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 67.207.67.3:53

I am using docker executor on gitlab runner as an image I am using docker:stable I am getting this error:

$ docker login gitlab.mydomain.com:5050 -u myusername-p mytoken
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 67.207.67.3:53: no such host
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

Here is my config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "dev-env"
  url = "https://gitlab.mydomain.com/"
  token = "REDACTED"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "docker:stable"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

Here is my ci file

deploy-dev:
  stage: deploy
  before_script:
    - apk add make
  script:
    - docker login gitlab.mydomain.com:5050 -u myusnerma -p mytoken
  only:
    - mybranch
  tags:
    - dev
like image 974
Sherzod Avatar asked Jan 23 '26 19:01

Sherzod


1 Answers

You must add the docker:dind service to your job configuration:

deploy-dev:
  variables:
    # these values may need to be different if using TLS, k8s, etc.
    # You can alternatively set defaults in your runner config
    DOCKER_TLS_CERTDIR: ""
    DOCKER_HOST: "tcp://docker:2375"
  services:
    - docker:dind
  # ...

For the dind container to work, your runner must allow privileged containers:

  [runners.docker]
    privileged = true
    # ...
like image 168
sytech Avatar answered Jan 26 '26 10:01

sytech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!