This project defines a default configuration for a GitLab runner. It creates a Docker container (with access to the host machine's Docker) where the runner runs as a shell runner.
This way, the runner will have all the shell and Docker functions, and if you need more, simply add them to the Dockerfile.
Feel free to clone and use.
Tool | Version |
---|---|
Docker | 28.0.4 |
Docker Compose | 2.34.0 |
Create a .env file following .env_sample and add the gitlab token.
It is necessary to allow the execution of scripts by running:
chmod +x ./*.sh
You may need to run the scripts as sudo if your user does not have the correct Docker permissions.
To create the volume and image, start the Docker container and set permissions on the Docker group and volume:
./start.sh
To register the container (already started) as a GitLab Runner shell:
./register.sh
To remove container, image and volume:
./stop.sh
To create and start the ssh server on the host machine (not inside the container):
./set-ssh.sh