获取你的token
## 启动docker
docker run -d --name gitlab-runner \
--restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
gitlab/gitlab-runner:alpine-v16.2.3
进入容器
# docker exec -it gitlab-runner bash
# gitlab-runner register
http://gitlab.neway.com
Enter the registration token:
NJrUkircTGxTzPtQfZUz -------------
Enter a description for the runner:
[2af202bf1943]: uat-config -------------
Enter tags for the runner (comma-separated):
uat,prod ---------------
Enter optional maintenance note for the runner:
uat-config -----------
WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872
Registering runner... succeeded runner=NJrUkirc
Enter an executor: virtualbox, docker-autoscaler, docker+machine, instance, custom, docker, parallels, ssh, kubernetes, docker-windows, shell:
docker ------------
Enter the default Docker image (for example, ruby:2.7):
docker:20.10.16 ------------
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml"
vim /srv/gitlab-runner/config/config.toml
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"]