1
resposta

Error: dial tcp: lookup docker on 169.254.169.254:53: no such host

Esse erro tinha aparecido no lab anterior, e voltou a aparecer nesse...

-- .gitlab-ci.yml

image: docker:19.03.0
stages:
- pre-build
- build
- test
- deploy

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""

build-docker:
  services:
    - docker:19.03.0-dind

  before_script:
    - docker info
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD

  script:
    - docker build -t minha-imagem .
    - docker tag minha-imagem thiagosagara/minha-imagem:latest
    - docker push thiagosagara/minha-imagem:latest

build-project:
  image: thiagosagara/minha-imagem:latest
  services:
  - docker:dind
  - mysql:5.7
  variables:
    MYSQL_USER: devops_dev
    MYSQL_PASSWORD: mestre
    MYSQL_DATABASE: todo_dev
    MYSQL_ROOT_PASSWORD: senha

    DB_HOST: 'mysql'
    DB_NAME: 'todo_dev'
    DB_USER: 'devops_dev'
    DB_PASSWORD: 'mestre'
    DB_PORT: '3306'
    SECRET_KEY: 'r*5ltfzw-61ksdm41fuul8+hxs$86yo9%k1%k=(!@=-wv4qtyv'


  stage: build
  tags:
  - executor
  dependencies:
  - build-docker
  script:
  - python manage.py makemigrations
  - python manage.py migrate

config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = ""
  url = ""
  token = ""
  executor = "docker"
  environment = ["DOCKER_TLS_CERTDIR="]
  [runners.docker]
    tls_verify = false
    image = ""
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    shm_size = 0

[[runners]]
  name = "runner-thiagosagara"
  url = "https://gitlab.com/"
  token = "54g5QbefHbWnyVNCP4Sx"
  executor = "docker"
  environment = ["DOCKER_TLS_CERTDIR="]
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.docker]
    tls_verify = false
    image = "thiagosagara/minha-imagem:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
1 resposta

Olá Thiago, tudo bem? Você poderia tentar colocar o environment = ["DOCKER_TLS_CERTDIR="] no inicio de cada sessão da seguinte forma:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  environment = ["DOCKER_TLS_CERTDIR="]
  name = ""
  url = ""
  token = ""
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = ""
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    shm_size = 0

[[runners]]
  environment = ["DOCKER_TLS_CERTDIR="]
  name = "runner-bytebank"
  url = "https://gitlab.com/"
  token = "XXXXXXXXXXXXXXXXXXXXXXXX"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.docker]
    tls_verify = false
    image = "jonilsonds9/minha-imagem:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

Acho que também pode ti ajudar dar uma olhada nesse outro tópico. E outra coisa muito importante pare o container antes de fazer qualquer mudança no arquivo config.toml.