GitLab CI: Docker in Docker (DinD) on Shared Runners


How to run DinD jobs on Shared Runners

This post is also available on my blog.

Gitlab provides shared runners for the repositories that are hosted on

You can run Docker commands inside a job by

  • selecting a runner that has the docker capability (tags: docker )
  • using the docker image for the job (image: docker:latest )
  • registering a docker:dind service (services: docker:dind )

An example running a container that says hello:

- Say Hello

stage: Say Hello
- docker
image: docker:latest
- docker:dind
- docker run --rm hello-world:latest
GitLab CI pipeline output



Orlando Thöny

PHP Software & DevOps Engineer. Moved to