docker-compose.yml:
version: '3.1'
services:
gitlab-runner:
restart: always
container_name: gitlab-runner
image: gitlab/gitlab-runner:latest
volumes:
- ./config:/etc/gitlab-runner
- ./data:/var/lib/mysql
- /var/run/docker.sock:/var/run/docker.sock
运行起来后,执行注册runner命令:
docker exec -it gitlab-runner gitlab-runner register
按提示输入gitlab地址,token等信息