In my particular scenario, I need to run both docker and docker-compose to test and build our changes. The first step to achieving this is to add an appropriate GitLab runner.
We especially need to run a privileged runner to make this happen.
Assuming that GitLab Runner has already been successfully installed, head to Admin -> Runner in the webUI of your GitLab instance and note your Registration token.
From a suitable account on your GitLab instance register a shared runner:
% sudo /usr/bin/gitlab-ci-multi-runner register --docker-privileged \
--url https://gitlab.my.domain/ci \
--registration-token REGISTRATION_TOKEN \
--executor docker \
--description "My Docker Runner" \
--docker-image "docker:latest" \
Your shared runner should now be ready to run.
This applies to self-hosting a GitLab instance. If you are using the gitlab.com hosted services, a suitable runner is already supplied.
There are many types of executors for runners, suiting a variety of scenarios. This example's scenario is that both GitLab and the desired runner are on the same instance.