系列文章
Gitlab Runner的docker-compose.yml
version: '3'
services:
home:
image: 'gitlab/gitlab-runner:v16.9.0'
scale: 2
restart: always
privileged: true
volumes:
- ./config:/etc/gitlab-runner
准备好文件之后,放在某个文件夹下
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners# ls
docker-compose.yml
启动容器
使用docker-compose up -d启动了两个容器
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners# docker-compose up -d
Creating network "gitlab-runners_default" with the default driver
Creating gitlab-runners_home_1 ... done
Creating gitlab-runners_home_2 ... done
用docker ps查看一下
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners/config# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
14e8b6c546b4 gitlab/gitlab-runner:v16.9.0 "/usr/bin/dumb-init …" 4 minutes ago Up 4 minutes gitlab-runners_home_2
6b9709615e72 gitlab/gitlab-runner:v16.9.0 "/usr/bin/dumb-init …" 4 minutes ago Up 4 minutes gitlab-runners_home_1
看看目录下的文件
在当前目录下,新创建了一个config的空白目录。
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners# docker-compose up -d
Creating gitlab-runners_home_1 ... done
Creating gitlab-runners_home_2 ... done
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners# ls
config docker-compose.yml
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners# cd config
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners/config# ls
root@dev-server:/mnt/data/gitlab.amihome.cn/gitlab-runners/config#
至此,就是初次安装Gitlab Runner成功的样子了。
接下来,我们要把gitlab-runners_home_1这个Gitlab Runner的容器实例,注册到https://gitlab.amihome.cn
请继续阅读这篇文章。
标签:compose,cn,Runner,gitlab,mnt,amihome,docker,runners From: https://www.cnblogs.com/amisoft/p/18044188/docker-compose-install-gitlab-runner