README.md 1.04 KB
Newer Older
Kevin Daudt's avatar
Kevin Daudt committed
1 2 3 4
# gitlab-runner docker image

This will create a docker image for running a gitlab runner on Alpine Linux on
all the architectures that Alpine Linux supports.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

## Starting the runner

To run the container, 1 required and 2 optional volumes need to be attached:

* docker socket (/var/run/docker.sock)
* conf dir (/etc/alpine-runner)
* home dir (/home/gitlab-runner)

For example:

```sh
docker run -d \
    -v /srv/gitlab-runner/conf:/etc/gitlab-runner \
    -v /srv/gitlab-runner/home:/home/gitlab-runner \
    -v /var/run/docker.sock:/var/run/docker.sock \
    gitlab-runner
```

You can execute `./run` to run this command

## Register the runner

There is a `./register-runner` command available in the container to register it.

To execute it, use the following command:

```sh
docker exec -e ARCH=<arch> -e GITLAB_REGISTER_TOKEN=<token> <container> register-runner
```

* `ARCH` is added as a tag on the runner
* `GITLAB_REGISTER_TOKEN` is a token you can find under `Settings > CI / CD > Runners`
  of a specific project or under `Admin > Overview > Runners`.