安装gitlab Runner
sudo docker pull gitlab/gitlab-runner:latest
sudo docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock gitlab-runner
不需要暴露端口,只提供给gitlab使用
docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
--non-interactive \
--executor "docker" \
--docker-image alpine:latest \
--url "http://47.103.84.150:8080" \
--description "first-register-runner" \
--tag-list "test-cicd1,dockercicd1" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected" \
--registration-token "TwDCSZEyygdh3goLwqew8"
registration-token 是
- 注册成功
|