Skip to content

Commit 323d219

Browse files
committed
update docker/gitlab.md
1 parent 4f54974 commit 323d219

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docker/gitlab.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,42 @@ MySuperSecretAndSecurePass0rd!
229229
```bash
230230
docker stack deploy --compose-file docker-compose.yml gitlab
231231
```
232+
233+
## [`注册 runner`](https://docs.gitlab.com/runner/install/docker.html)
234+
235+
### 更新配置
236+
237+
如果您在 `config.toml` 中更改配置,则可能需要重新启动运行程序以应用更改。 确保重新启动整个容器,而不是使用 `gitlab-runner restart`
238+
239+
```shell
240+
docker restart gitlab-runner
241+
```
242+
243+
### 升级版本
244+
245+
Pull the latest version (or a specific tag):
246+
247+
```shell
248+
docker pull gitlab/gitlab-runner:latest
249+
```
250+
251+
Stop and remove the existing container:
252+
253+
```shell
254+
docker stop gitlab-runner && docker rm gitlab-runner
255+
```
256+
257+
Start the container as you did originally:
258+
259+
```shell
260+
docker run -d --name gitlab-runner --restart always \
261+
-v /var/run/docker.sock:/var/run/docker.sock \
262+
-v /home/docker/gitlab-runner/config:/etc/gitlab-runner \
263+
gitlab/gitlab-runner:latest
264+
```
265+
266+
服务 gitlab-runner 跑起来之后可以注册对应的仓库
267+
268+
```
269+
docker run --rm -it -v /home/docker/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
270+
```

0 commit comments

Comments
 (0)