安装 docker
[root@sannian wode.bak]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
下载 gitlab-runner
[root@sannian wode.bak]# docker search gitlab-runner
[root@sannian wode.bak]# docker pull gitlab/gitlab-runner
运行runner
[root@sannian wode.bak]# docker run -d --name gitlab-runner --restart always gitlab/gitlab-runner
注册
[root@sannian wode.bak]# docker exec -it gitlab-runner gitlab-ci-multi-runner register
Runtime platform arch=amd64 os=linux pid=11 revision=cf91d5e1 version=11.4.2
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://www.1314916.com:9999/
Please enter the gitlab-ci token for this runner:
_8iT1NFZVqf_yq2xDdH2
Please enter the gitlab-ci description for this runner:
[27b613653221]: 1314916
Please enter the gitlab-ci tags for this runner (comma separated):
14^H^C[root@sannian wode.bak]# docker exec -it gitlan-runner gitlab-ci-multi-runner register
Runtime platform arch=amd64 os=linux pid=20 revision=cf91d5e1 version=11.4.2
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://www.1314916.com:9999/
Please enter the gitlab-ci token for this runner:
_8sdffsfdfFZdfqf_yq2xDdH2
Please enter the gitlab-ci description for this runner:
[27b613653221]: 1314916
Please enter the gitlab-ci tags for this runner (comma separated):
1314916
Registering runner... succeeded runner=_8iT1NFZ
Please enter the executor: docker+machine, docker-ssh+machine, docker, docker-ssh, parallels, shell, ssh, virtualbox, kubernetes:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
[root@sannian wode.bak]# docker exec -it gitlan-runner gitlab-ci-multi-runner list
Runtime platform arch=amd64 os=linux pid=32 revision=cf91d5e1 version=11.4.2
Listing configured runners ConfigFile=/etc/gitlab-runner/config.toml
1314916 Executor=shell Token=761fdc8eaeb675c81f28edaadc7e3e URL=http://www.1314916.com:9999/
然后在web上查看