Improve documentation of how to build Docker Images with GitLab CI
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:
-
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, whendocker: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.
-
Adding
DOCKER_HOST
andDOCKER_DRIVER
variable definitions in the examples that are usingdocker: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 ofDOCKER_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 2018overlay2
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 whenoverlay2
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.