I've been trying to get docker up and running in gitlab-runner but keep getting errors such as one below or Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
.gitlab-ci.yml
build:
stage: build
image: docker:latest
services:
- name: docker:dind
alias: docker
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- docker info
results:
$ docker info
Client:
Debug Mode: false
Server:
ERROR: error during connect: Get http://docker:2375/v1.40/info: dial tcp: lookup docker on 10.233.0.3:53: server misbehaving
errors pretty printing info
Runner is not in privileged mode. Is there a way to build a docker image in runner without privileged mode?
And if no, are there other practices and what important cons does this flag bring?
gitlab-ci.yml? - Umar Hussaindocker:latest, this is for now the only active job and image in pipeline. - Penguin74