0%

Install-Gitlab-Runner-with-Docker

Gitlab-Runner 安装

安装命令

1
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

注册Runner

1
sudo gitlab-runner register

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[[runners]]
name = "unity-compiler"
url = "https://gitlab.example.com/"
token = ""
executor = "docker"
[runners.docker]
host= "tcp://localhost:2375"
pull_policy = "if-not-present"
extra_hosts = ["gitlab.example.com:192.168.3.55"]
tls_verify = false
image = "gableroux/unity3d:2017.4.10f1"
privileged = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]

Docker 安装

1
2
3
4
5
6
7
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt-cache policy docker-ce
sudo apt install docker-ce -y

设置DOCKER_HOST

1
echo "export DOCKER_HOST=localhost:2375" >> ~/.bash_profile

镜像测试命令

1
docker run --net host -it --rm -e "UNITY_USERNAME=your-user-name" -e "UNITY_PASSWORD=your-password" gableroux/unity3d:2018.3.12f1

Cache Server

1
2
3
4
docker run -it --restart always -p 9005:9000 \
-v /disk_dump/cache_server/.minio:/root/.minio:z -v /disk_dump/cache_server/export:/export:z \
--name minio \
minio/minio:latest server /export

Can’t mount host data directory to minio server docker container

[SELinux 添加权限][^3]

1
2
cat /var/log/audit/audit.log | grep minio | grep denied | audit2allow -M minio
semodule -i minio.pp

Reference