Mentions légales du service

Skip to content

Use docker-in-docker (dind) for docker builds

E. Madison Bray requested to merge embray/ci/dind into master

This method for building/deploying Docker images in GitLab CI seems to be the most recommended.

Previously we configured our runners so that it was possible for the builds to directly talk to the Docker daemon of the host system of the runner.

What "dind" does is it denies access of the CI job to the host's Docker daemon, and instead spins up its own Docker daemon as a service (hence "docker-in-docker" since it is running a Docker daemon in a Docker container).

This is the way things have to be configured, also, to take advantage of gitlab.com's shared runners for building Docker images, on the public repository.

One downside is more overhead involved in pulling existing built containers, since they have to be re-pulled every time the "docker:dind" service starts up. I wonder if there is a workaround for that...

Merge request reports