Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dind-sidecar example requires old dind sidecar image? #1929

Closed
imjasonh opened this issue Jan 23, 2020 · 1 comment · Fixed by #1932
Closed

dind-sidecar example requires old dind sidecar image? #1929

imjasonh opened this issue Jan 23, 2020 · 1 comment · Fixed by #1932
Labels
kind/question Issues or PRs that are questions around the project or a particular feature

Comments

@imjasonh
Copy link
Member

imjasonh commented Jan 23, 2020

Found while iterating on #1928

If the image used in the dind sidecar is any later than :18.09-dind (15 months old at this point, and verrrry far out of the support window), Docker operations fail:

[client] docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
[client] See 'docker run --help'.
[client] time="2020-01-23T19:59:54Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory"
[client] error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=xjdfz63zazhjfy3hi2th0x5yl&shmsize=0&t=hello&target=&ulimits=null&version=1: context canceled
[client] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[client] docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
[client] See 'docker run --help'.

/kind question

@tekton-robot tekton-robot added the kind/question Issues or PRs that are questions around the project or a particular feature label Jan 23, 2020
@imjasonh
Copy link
Member Author

Seems relevant: https://docs.gitlab.com/runner/executors/kubernetes.html#using-dockerdind

.../var/run/docker.sock is not shared by the docker:dind container and the docker binary tries to use it by default.

To overwrite this and make the client use TCP to contact the Docker daemon, in the other container, be sure to include the environment variables of the build container:

DOCKER_HOST=tcp://localhost:2375 for no TLS connection.
DOCKER_HOST=tcp://localhost:2376 for TLS connection.

Make sure to configure those properly. As of Docker 19.03, TLS is enabled by default but it requires mapping certificates to your client. You can enable non-TLS connection for DIND or mount certificates as described in Use Docker In Docker Workflow with Docker executor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issues or PRs that are questions around the project or a particular feature
Projects
None yet
2 participants