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



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store