Sign inSign up

smueller18/gitlab-runner

By smueller18

•Updated over 7 years ago

Gitlab Runner

Image
0

7.2K

smueller18/gitlab-runner repository overview

⁠gitlab-runner

This is a Gitlab runner which registers before running and automaticly unregisters the runner after a stop signal has sent to the container.

⁠Custom TLS certificates

Custom CA certificates can be placed in /usr/local/share/ca-certificates/ca.crt. If this file is available, the CA certificates will be updated automatically.

⁠Git config

Git is configured to include the CA path /etc/ssl/certs/ca-certificates.crt.

⁠Environment Variables

The following environment variables are available to customize the runner registration:

VariableRequiredDefaultTypeDescription
TOKENyesStringRunner token
URLyesUrlGitlab Url
NAMEyesStringUnique name of the runner
TAG_LISTnoString (comma seperated)List of tags
LOCKEDnofalseBoolean
DOCKER_IMAGEnodocker:latestStringDefault image for jobs
PRIVILEGEDnofalseBooleanOn true, job containers run privileged
SHARE_DOCKER_SOCKETnofalseBooleanOn true, volume /var/run/docker.sock:/var/run/docker.sock is mounted.
TZnoTimezone StringSet custom timzone
SHARE_ZONEINFOnotrueBooleanOn true and if TZ is set, volume /usr/share/zoneinfo:/usr/share/zoneinfo:ro is mounted
ADDITIONAL_OPTIONSnoStringAny available options can be inserted here. To see the list of all available options run docker run --rm --entrypoint "/usr/bin/gitlab-runner" smueller18/gitlab-runner register --help

Here is an example how the variable ADDITIONAL_OPTIONS can be used:

docker run -e ADDITIONAL_OPTIONS="--env TEST=test" smueller18/gitlab-runner

⁠Running

When starting the image, the Gitlab runner is registerd with the given options. After the runner has registered sucessfully, the Gitlab runner run command is executed. When a stop signal is sent to the container, the Gitlab runner stops and the runner will be unregistered so that it gets removed from Gitlab immediately.

Attention: If a Gitlab runner is not stopped regularly (e.g. force kill), the runner is not unregistered. Therefore, the runner will always be listed in the runners list and must be removed from hand.

Here is an example of a docker-compose file:

version: '2.3'

services:
  runner:
    image: smueller18/gitlab-runner
    restart: always
    environment:
      URL: ${URL}
      TOKEN: ${TOKEN}
      NAME: unique-runner-name
      PRIVILEGED: "true"
      TZ: Europe/Berlin
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/share/zoneinfo:/usr/share/zoneinfo:ro

Tag summary

Content type

Image

Digest

Size

36.9 MB

Last updated

over 7 years ago

docker pull smueller18/gitlab-runner