Sign inSign up

ikus060/gitlab-runner

By ikus060

•Updated almost 6 years ago
Archived

Docker gitlab runner with automatic registration/deregistration based on docker run/stop

Image
1

10K+

ikus060/gitlab-runner repository overview

Build Status

⁠docker-gitlab-runner

This repository provides a Docker image for Gitlab runners with automatic registration/deregistration based on docker run/stop and provide a docker-compose.yml file to install Gitlab with CICD.

⁠Docker image usage

To start a Gitlab runner only, without docker-compose, you may run this command:

docker run -d -v "/var/run/docker.sock:/var/run/docker.sock" -e "GITLAB_URL=http://gitlab.example.com" -e "GITLAB_RUNNER_TOKEN=changeme" ikus060/gitlab-runner:latest

This will start a single instance of Gitlab runners with default configuration.

Required variables:

Optional variables:

  • GITLAB_REGISTER_ARGS: extra arguments passed to gitlab-runner register. This can be used to add more arguments for docker: --docker-volumes. To have a complete list of available arguments execute docker run -it gitlab/gitlab-runner:latest register --help
  • GITLAB_CONCURRENT: limits how many jobs globally can be run concurrently. The most upper limit of jobs using all defined runners. 0 does not mean unlimited. Default: 1

⁠Docker-compose usage

You need to start Gitlab at least once before starting the runner.

git clone https://github.com/ikus060/docker-gitlab-runner.git
cd docker-gitlab-runner 
docker-compose up web

Once Gitlab is available, browse to http://example.com/admin/runners/⁠ and get the registration token. You may then start the runner using the token.

GITLAB_RUNNER_TOKEN=Qz3sxs3x5ZP6xNMTw9bA  docker-compose up runner

As a more permanent solution, you may store the token into .env file.

Tag summary

Content type

Image

Digest

Size

303.7 MB

Last updated

almost 6 years ago

docker pull ikus060/gitlab-runner