If I want to use the
docker commands in a job (for example for building an image or pushing to a registry), I understood that within the
image: part of the job I have to have an image in which the
docker command is available… So let’s simply have:
build_job: image: docker:latest
But then, why I need to have for that job also the following service config?
build_job: image: docker:latest services: - docker:dind
I was thinking that since the job will be ran inside the
docker image and that the
docker command will be available, why the service is still required?
Also, I tried for example to use
docker:latest as the service. That doesn’t work.
docker:dind as the image does work.
I’ll be happy to understand the differences.
Thank you very much.