Setting up a gitlab-runner from within unraid

Enable community applications for unraid tobegin with (This is what i used to get access to more apps from DockerHub). Click here to find out how to do this.

You will need to enabled Enable additional search results from dockerHub? from here: http://tower.local/Apps/ca_settings

Now simply go to apps, search for gitlab-runner, click ‘get more results from docker hub’ and then install the app.

Once loaded head over the docker tab, edit your new docker container and add a mapping for the config for the gitlab-runner. For me I did

/mnt/user/appdata/gitlab-runner-1 --> /etc/gitlab-runner

Now go into the container and register the runner to your gitlab instance. You can find your registration token and URL for the runner from /admin/runners within your gitlab instance. You can set your tags now or edit them in the UI after the runner is setup.

1
gitlab-runner register --non-interactive --url "https://XXXX.XXXX/" --registration-token "XXXXXXXXX" --executor "docker" --docker-image kroniak/ssh-client --description "docker-runner" --tag-list "docker,aws" --run-untagged="true" --locked="false"

In the above example I use ‘kroniak/ssh-client’ as my base instance but you can pick anything such as alpine:latest or debian:jessie. I find that kroniak/ssh-client has everything I need and is as slim as possible.

This is the very basics of how to get it set up, you can see examples of gitlab-ci.yml using this seutp over in the repository for this blog site.

I’ve also tweaked around with my config.toml that will appear in /mnt/user/appdata/gitlab-runner-1, if you disable the cache directory it won’t leave old docker containers behind in UNRaid.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
name = "docker-runner"
url = "https://XXXXXxx.XXXXXXXX/"
token = "XXXXXXXXX"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "kroniak/ssh-client"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = true
volumes = []
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]