A dockerized GitLab runner that automatically registers before running. The first time the container runs it is registered with GitLab. If the configuration file already exists this step is skipped.
For a shell runner run
docker run --detach \
--name gitlab-runner \
--restart=always \
-e REGISTRATION_TOKEN=XXXXXXXXXX \
-e CI_SERVER_URL=http://gitlab.mydomain.com \
-e RUNNER_EXECUTOR=shell \
-e RUNNER_SHELL=bash \
--volume /etc/gitlab-runner:/etc/gitlab-runner \
phihos/gitlab-runner
For a Docker runner run
docker run --detach \
--name gitlab-runner \
--restart always \
-e REGISTRATION_TOKEN=XXXXXXXXXX \
-e CI_SERVER_URL=http://gitlab.mydomain.com \
-e RUNNER_EXECUTOR=docker \
-e DOCKER_IMAGE="ubuntu:latest" \
--volume /etc/gitlab-runner:/etc/gitlab-runner \
--volume /var/run/docker.sock:/var/run/docker.sock \
phihos/gitlab-runner
For a list of possible environment variables run
docker run gitlab/gitlab-runner register --help
Each command line options has a corresponding environment variable that can be set. Currently the RUNNER_ENV variable does not allow multiple values (see below).
Currently it is not possible to specify multiple environment variables via RUNNER_ENV. As a workaround you can specify RUNNER_ENV_1, RUNNER_ENV_2, ..., RUNNER_ENV_256. This fix was taken from here.
Please see LICENSE