2019-10-05 【Gitlab】使用 docker 运行

2019-10-05  本文已影响0人  耕耘菜菜
  1. 拉取镜像
docker pull gitlab/gitlab-ce:latest
  1. docker 运行 Gitlab

/srv/gitlab 为主机 gitlab 的目录

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab \
  --volume /srv/gitlab/logs:/var/log/gitlab \
  --volume /srv/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest
  1. 注册 runner
[root@test-server gitlab-runner]$ docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register

Runtime platform                                    arch=amd64 os=linux pid=8 revision=a6a017e0 version=12.3.0
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://gitlab.example.com:80/

Please enter the gitlab-ci token for this runner:
VEmag2FJCJsJuSAHQbtz

Please enter the gitlab-ci description for this runner:
[8857df3a8756]: test-runner

Please enter the gitlab-ci tags for this runner (comma separated):
test-runner
Registering runner... succeeded                     runner=VEagb2CJ

Please enter the executor: docker-ssh+machine, docker-ssh, parallels, shell, virtualbox, kubernetes, custom, docker, ssh, docker+machine:
docker

Please enter the default Docker image (e.g. ruby:2.6):
alpine:latest

Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
  1. 登录 http://gitlab.example.com:80/admin/runners 查看 runners
image.png

参考资料

上一篇 下一篇

猜你喜欢

热点阅读