• Stars
    star
    145
  • Rank 254,144 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker Repository on Quay.io

sameersbn/gitlab-ci-multi-runner:1.1.4-7

Introduction

Dockerfile to create a Docker container base image for gitlab-ci-multi-runner. Use this image to build your CI runner images.

Contributing

If you find this image useful here's how you can help:

  • Send a pull request with your awesome features and bug fixes
  • Help users resolve their issues.
  • Support the development of this image with a donation

Issues

Before reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker installation guide for instructions.

SELinux users should try disabling SELinux using the command setenforce 0 to see if it resolves the issue.

If the above recommendations do not help then report your issue along with the following information:

  • Output of the docker version and docker info commands
  • The docker run command or docker-compose.yml used to start the image. Mask out the sensitive bits.
  • Please state if you are using Boot2Docker, VirtualBox, etc.

Getting started

Installation

Automated builds of the image are available on Dockerhub and is the recommended method of installation.

Note: Builds are also available on Quay.io

docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-7

Alternatively you can build the image yourself.

docker build -t sameersbn/gitlab-ci-multi-runner github.com/sameersbn/docker-gitlab-ci-multi-runner

Quickstart

Before a runner can process your CI jobs, it needs to be authorized to access the the GitLab CI server. The CI_SERVER_URL, RUNNER_TOKEN, RUNNER_DESCRIPTION and RUNNER_EXECUTOR environment variables are used to register the runner on GitLab CI.

docker run --name gitlab-ci-multi-runner -d --restart=always \
  --volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
  --env='CI_SERVER_URL=http://git.example.com/ci' --env='RUNNER_TOKEN=xxxxxxxxx' \
  --env='RUNNER_DESCRIPTION=myrunner' --env='RUNNER_EXECUTOR=shell' \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7

Alternatively, you can use the sample docker-compose.yml file to start the container using Docker Compose

Update the values of CI_SERVER_URL, RUNNER_TOKEN and RUNNER_DESCRIPTION in the above command. If these enviroment variables are not specified, you will be prompted to enter these details interactively on first run.

Command-line arguments

You can customize the launch command by specifying arguments to gitlab-ci-multi-runner on the docker run command. For example the following command prints the help menu of gitlab-ci-multi-runner command:

docker run --name gitlab-ci-multi-runner -it --rm \
  --volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7 --help

Persistence

For the image to preserve its state across container shutdown and startup you should mount a volume at /home/gitlab_ci_multi_runner/data.

The Quickstart command already mounts a volume for persistence.

SELinux users should update the security context of the host mountpoint so that it plays nicely with Docker:

mkdir -p /srv/docker/gitlab-runner
chcon -Rt svirt_sandbox_file_t /srv/docker/gitlab-runner

Deploy Keys

At first run the image automatically generates SSH deploy keys which are installed at /home/gitlab_ci_multi_runner/data/.ssh of the persistent data store. You can replace these keys with your own if you wish to do so.

You can use these keys to allow the runner to gain access to your private git repositories over the SSH protocol.

NOTE

  • The deploy keys are generated without a passphrase.
  • If your CI jobs clone repositories over SSH, you will need to build the ssh known hosts file which can be done in the build steps using, for example, ssh-keyscan github.com | sort -u - ~/.ssh/known_hosts -o ~/.ssh/known_hosts.

Trusting SSL Server Certificates

If your GitLab server is using self-signed SSL certificates then you should make sure the GitLab server's SSL certificate is trusted on the runner for the git clone operations to work.

The runner is configured to look for trusted SSL certificates at /home/gitlab_ci_multi_runner/data/certs/ca.crt. This path can be changed using the CA_CERTIFICATES_PATH enviroment variable.

Create a file named ca.crt in a certs folder at the root of your persistent data volume. The ca.crt file should contain the root certificates of all the servers you want to trust.

With respect to GitLab, append the contents of the gitlab.crt file to ca.crt. For more information on the gitlab.crt file please refer the README of the docker-gitlab container.

Similarly you should also trust the SSL certificate of the GitLab CI server by appending the contents of the gitlab-ci.crt file to ca.crt.

Maintenance

Upgrading

To upgrade to newer releases:

  1. Download the updated Docker image:
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-7
  1. Stop the currently running image:
docker stop gitlab-ci-multi-runner
  1. Remove the stopped container
docker rm -v gitlab-ci-multi-runner
  1. Start the updated image
docker run -name gitlab-ci-multi-runner -d \
  [OPTIONS] \
  sameersbn/gitlab-ci-multi-runner:1.1.4-7

Shell Access

For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0 or higher you can access a running containers shell by starting bash using docker exec:

docker exec -it gitlab-ci-multi-runner bash

List of runners using this image

More Repositories

1

docker-gitlab

Dockerized GitLab
Shell
7,893
star
2

docker-redmine

Docker Image for Redmine
Shell
1,255
star
3

docker-postgresql

Dockerfile to build a PostgreSQL container image which can be linked to other containers.
Shell
1,050
star
4

docker-bind

Dockerize BIND DNS server with webmin for DNS administration
Shell
913
star
5

docker-squid

Dockerfile to create a Docker container image for Squid proxy server
Shell
818
star
6

docker-browser-box

Dockerized google-chome and tor-browser with audio support via pulseaudio
Shell
574
star
7

docker-mysql

A Dockerfile that installs a mysql server
Shell
247
star
8

docker-apt-cacher-ng

Dockerfile to create a Docker container image for Apt-Cacher NG
Shell
210
star
9

docker-gitlab-ci

Dockerfile to build a GitLab CI container image.
Shell
199
star
10

docker-redis

Dockerfile to create a Docker container image for Redis.
Shell
156
star
11

docker-skype

Dockerized skype with voice and video call support
Shell
139
star
12

docker-gitlab-ci-runner

Dockerfile to build a base GitLab CI Runner container image.
Shell
98
star
13

docker-openfire

Dockerfile to create a Docker container image for Openfire.
Shell
81
star
14

docker-nginx

A Dockerfile that installs nginx (from source) with nginx-rtmp module support (php5 support can be added using the sameersbn/php5-fpm image)
Shell
76
star
15

docker-wowza

Dockerfile to containerize Wowza Streaming Engine
Shell
64
star
16

docker-mongodb

Dockerfile to build a MongoDb container image which can be linked to other containers.
Shell
47
star
17

docker-invoiceplane

Dockerfile to create a Docker container image for InvoicePlane
Shell
45
star
18

docker-owncloud

Experimental owncloud image for docker
Shell
34
star
19

docker-ubuntu

My Ubuntu boilerplate image that forms the base for my docker containers.
Makefile
33
star
20

docker-nextcloud

Shell
31
star
21

docker-runner-gitlab

A CI runner for gitlab-ce built on top of the https://github.com/sameersbn/docker-gitlab-ci-runner
Shell
27
star
22

docker-memcached

Dockerfile to build a memcached container image which can be linked to other containers.
Dockerfile
27
star
23

docker-extras

Helper scripts for everyday docker use.
Shell
19
star
24

docker-akaunting

Docker for Akaunting
Shell
19
star
25

docker-ffmpeg

Base your docker image on this image if you need a bleeding egde version of fffmpeg.
Shell
17
star
26

docker-laboard

Docker file to build a Laboard image
Shell
10
star
27

docker-php-fpm

Dockerfile to build a php-fpm container.
Dockerfile
8
star
28

docker-nodejs

Dockerfile to build a nodejs+express image with nodemon
Shell
7
star
29

docker-rygel

Dockerfile to build a Rygel DLNA/uPNP server docker image.
Makefile
7
star
30

docker-skypeforlinux

Dockerized Skype for Linux (alpha)
Shell
6
star
31

docker-mysql2psql

Dockerfile that packages mysql2psql and py-mysql2pqsql tools.
Makefile
6
star
32

docker-debian

debian jessie baseimage that packs a couple of extra packages.
Makefile
2
star