Skip to content

Improve documentation of how to build Docker Images with GitLab CI

Tomasz Maczukin requested to merge improve-using-docker-build-docs into master

What does this MR do?

Improves the documentation at https://docs.gitlab.com/ee/ci/docker/using_docker_build.html. There are two things that need the improvement:

  1. Missing DOCKER_HOST variable definition, when describing the docker-in-docker approach. Without this variable docker client used in the script will fail, because it will try to use the default communication point, which is /var/run/docker.sock socket. Such file doesn't exist, when docker:dind service is used!

    At this moment I know at least one case when the user was going set-by-step according to this documentation and the job started to fail. And there was nothing that would explain what and why is failing. This MR is added to fill this gap.

  2. Adding DOCKER_HOST and DOCKER_DRIVER variable definitions in the examples that are using docker:dind approach.

    If we're providing a short examples, we should make them working when used as it is presented in the documentation. As mentioned above - without DOCKER_HOST the example will not work. And since we're mentioning that usage of DOCKER_DRIVER: overlay2 is a good idea, that will speed up jobs, we should also add it by default. I'd risk a statement, that in 2018 overlay2 should be available in most cases. IMO it's better to add it by default and speed the jobs, and let user debug the problem only in these few cases when overlay2 will not work.

Live preview at http://ce-review-docs-impro-dfhyns.178.62.207.141.xip.io/ce/ci/docker/using_docker_build.html.

Edited by Tomasz Maczukin

Merge request reports

Loading