Commit 648eb089 authored by Kevin Daudt's avatar Kevin Daudt

docker-compose: use a .env file for parameters

Instead of modifying the docker-compose file, it's easier and better to
use a `.env` file where you can provide the parameters for this runner.
parent 85eb9608
Pipeline #4790 passed with stages
in 3 minutes and 9 seconds
......@@ -8,13 +8,14 @@ all the architectures that Alpine Linux supports.
## Starting the runner
There is a `docker-compose.yml` file included that starts up the runner. The
registration of the runner will be done automatically, but you need to modify
the file to specify some parameters:
registration of the runner will be done automatically, but you need to provide a
`.env` file with some parameters. There is an `example.env` file that you can use
as a template.
* `<shared-token>` - The gitlab registration token (you can find it in the admin pannel
under runners)
* `<docker-token>` - The gitlab registration token for the dedicated docker
image runner. This token should come from a project or group.
* `<arch>` - The architecture for this runner (used as a description and tag).
* `GITLAB_REGISTRATION_TOKEN_SHARED` - The gitlab registration token (you can
find it in the admin pannel under runners)
* `GITLAB_REGISTRATION_TOKEN_DOCKER` - The gitlab registration token for the
dedicated docker image runner. This token should come from a project or group.
* `ARCH` - The architecture for this runner (used as a description and tag).
Then run `docker-compose up -d` and the runner should be running.
......@@ -2,12 +2,12 @@ version: "3"
services:
gitlab-runner:
build: .
image: alpinelinux/gitlab-runner:latest
image: alpinelinux/gitlab-runner:latest-${ARCH}
restart: always
volumes:
- /srv/gitlab-runner/conf:/etc/gitlab-runner
- /srv/docker/gitlab-runner-${ARCH}/conf:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
environment:
GITLAB_REGISTRATION_TOKEN_SHARED: <shared-token>
GITLAB_REGISTRATION_TOKEN_DOCKER: <docker-token>
ARCH: <arch>
- GITLAB_REGISTRATION_TOKEN_SHARED
- GITLAB_REGISTRATION_TOKEN_DOCKER
- ARCH
GITLAB_REGISTRATION_TOKEN_SHARED=<token>
GITLAB_REGISTRATION_TOKEN_DOCKER=<token>
ARCH=<arch>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment