GitLab-CI multi runner start docker container

I still don’t quite understand the process for a gitlab-ci multi runner to start a docker and interact inside with the code.

Is it possible for a gitlab-ci multi runner to start a docker container having the current code inside this docker container and then run tests against this code? (e.g.: code linting)

  • Configure the network interfaces of the host a docker container is running on
  • Switching from Heroku to Docker Platform problems
  • Mount current directory as volume in Docker on Windows 10
  • Docker container not starting a second time (iptables)
  • Pycharm 5 remote python interpreter in a Docker container: non-zero exit code
  • How can I create a user using htdigest without prompting for password
  • I basically want a docker container that has various linters installed.
    GitLab-CI multi runner should run on the host system and start the docker container on-demand. Inside the docker container, the code should be checked against phpcs for example.

    How do I get the repo code into the docker container?

    Thanks for the help

  • Docker: skygear server not starting, connection refused
  • AWS codebuild not passing down environment variables?
  • docker smack security on ubuntu
  • Docker - pull from docker repo fails (EOF / 403) but download from RH repo works
  • How do I deploy updated Docker images to Amazon ECS tasks?
  • Docker MAC Address Generation
  • 2 Solutions collect form web for “GitLab-CI multi runner start docker container”

    First, gitlab-runner needs to have the Docker socket mounted as described in the documentation:

    docker run -d --name gitlab-runner --restart always \
     -v /var/run/docker.sock:/var/run/docker.sock \
     -v /srv/gitlab-runner/config:/etc/gitlab-runner \

    Afterwards, you have to register the runner with:

    1. docker as executor.
    2. the Docker image with the linters you want as Docker image.

    Every docker client will forward the commands to the docker daemon,the docker daemon will listen to the local port such as http,tcp or unix socket.

    When you start container like this:

    docker run -d –name gitlab-runner –restart always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /srv/gitlab-runner/config:/etc/gitlab-runner \

    All the docker commands will forward to the host,as the docker was listening on unix:///var/run/docker.sock

    PS: You nedd to install docker in the gitlab-runnercontainer

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.