Public | Automated Build

Last pushed: 2 years ago
Short Description
Gitlab CI runner docker image with ssh-key sharing and php7 basic stack and ZMQ extension enabled
Full Description

Docker GitlabCI Runner images

Gitlab CI runner docker base images with ssh-key sharing.

This repo is based on bobey/docker-gitlab-ci-runner repository.

Table of contents

PHP Images

We provide docker gitlab-ci runner images for PHP 7 containing the following stack:

  • PHP 7.x
  • Git
  • Composer
  • NodeJS


You can run as many runners as you want by executing:

docker run \
  -e REGISTRATION_TOKEN=replaceme \
  -e HOME=/root \
  -e \
  -v /absolute/path/to/your/home/.ssh/id_rsa:/root/.ssh/id_rsa:ro \

In your GitlabCI, a basic phpunit job could looks like this:

composer install
php vendor/phpunit/phpunit/phpunit --coverage-text

By displaying code coverage as text, you can easily extract code coverage metrics. In your project settings, under
"Test coverage parsing", just input the following regex: Lines:\s+(\d+.\d+\%).

Custom PHP configuration

All PHP images comes with the following extensions pre-installed but not enabled by default with the exception of
xdebug and zmq:


If you need to customize the php configuration, you can add your own settings to the ci-runner.ini file.
For example, the following command in one of your gitlab-ci jobs will enable extension:

echo 'extension=""' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/ci-runner.ini

You can of course customize any other parameter of the php.ini configuration file. Below command will set
Europe/Paris as the default timezone:

echo 'date.timezone="Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/ci-runner.ini

Composer and Github API rate limit

All PHP images comes with Composer pre-installed and ready to be used. But, as you might already know, Github API rate
limit is quite often reached when building projects in CI. See what Composer doc say about it.

One way to handle this problem is to create an auth.json file and share it with your gitlab-ci-runners via a volume:

    "http-basic": {},
    "github-oauth": {

Then, start your runner with an extra -v option:

docker run \
  -e ...
  -v /absolute/path/to/composer-auth.json:/root/.composer/auth.json:ro \


This docker image is based on bobey/docker-gitlab-ci-runner image. In order to build it, you need to execute the
following command:

docker build -t gamerswalk/docker-gitlab-ci-runner-php7.0


Remember this repo is based on bobey/docker-gitlab-ci-runner

Docker Pull Command