GitLab CI: Docker in Docker (DinD) on gitlab.com Shared Runners

How to run DinD jobs on gitlab.com Shared Runners
Gitlab provides shared runners for the repositories that are hosted on gitlab.com: https://docs.gitlab.com/ee/ci/runners/README.html#shared-runners
You can run Docker commands inside a job by
selecting a runner that has the
dockercapability (tags: docker)using the
dockerimage for the job (image: docker:latest)registering a
docker:dindservice (services: docker:dind)
An example running a container that says hello:
stages:
- Say Hello
hello-world:
stage: Say Hello
tags:
- docker
image: docker:latest
services:
- docker:dind
script:
- docker run --rm hello-world:latest
GitLab CI pipeline output

