詳細內容請參考官方文件
https://docs.gitlab.com/runner/install/docker.html
一、安裝 Docker
sudo yum install docker
二、啟動 Docker
sudo service docker start
三、建立 Gitlab Runner Container
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/gitlab-runner:latest
四、進入 Container
sudo docker exec -it gitlab-runner bash
五、註冊 Gitlab Registry
gitlab-runner register
然後輸入相關url和token,executer選擇docker
六、啟動Gitlab Runner
gitlab-runner start