第一步:找到runner容器
[root@18 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
888895b79748 gitlab/gitlab-runner:latest "/usr/bin/dumb-init …" 4 days ago Up 5 minutes gitlab-runner
第二步:找到本机配置文件
[root@18 ~]# docker inspect gitlab-runner | grep volume
"Type": "volume",
"Source": "/var/lib/docker/volumes/gitlab-runner-config/_data",
或者先找到volume,然后再找配置文件
[root@18 ~]# docker volume inspect gitlab-runner-config
[
{
"CreatedAt": "2023-06-02T14:59:30+08:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/gitlab-runner-config/_data",
"Name": "gitlab-runner-config",
"Options": {},
"Scope": "local"
}
]
第三步:修改本地挂载的配置文件
[root@18 ~]# vim /var/lib/docker/volumes/gitlab-runner-config/_data/config.toml
第四步:重启runner容器
[root@18 ~]# docker restart gitlab-runner