Trying to run the local gitlab runner with docker executor for running the ci pipeline jobs with ‘linux’ tag
following is .gitlabci.yml
stages:
- build
variables:
CONTAINER_COMMIT_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
PYTHON_TEST_IMAGE: python:3.7-alpine
DOCKER_IMAGE: docker:19.03.1
DIND_IMAGE: $DOCKER_IMAGE-dind
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
web:
stage: build
image: $DOCKER_IMAGE
tags:
- linux
services:
- $DIND_IMAGE
before_script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script:
- docker build --build-arg GITLAB_CI_TOKEN=$GITLAB_CI_TOKEN --pull -t $CONTAINER_COMMIT_IMAGE-web .
- docker push $CONTAINER_COMMIT_IMAGE-web
when: manual
following is the gitlab-runner config file config.toml
concurrent = 1
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "docker-runner"
url = "https://gitlab.com/"
id = xxxxx
token = "<GITLAB_TOKEN>"
token_obtained_at = 2024-05-07T11:28:16Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
MaxUploadedArchiveSize = 0
[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 = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
shm_size = 0
network_mtu = 0
when I run the CI job I am getting the following error
error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 192.168.0.1:53: no such host
I also tried setting the privileged = true
, but still getting the same error. I have even added the entry in /etc/hosts
as 192.168.0.1 docker
too, but the output is still the same.
following is /etc/hots
ABC@XYZ:/var/run$ sudo cat /etc/hosts
192.168.0.1 docker
Is there any configuration I am missing or need to rectify? Any help will be appreciated