GitHub Actions runner within a Docker Container
10K+
Host your own GitHub action runners within Docker.
Your GitHub actions runner can be started using docker run or docker-compose.
Make sure you swap out the GITHUB_REPO_URL and GITHUB_TOKEN variables for your configuration.
docker run -d \
-e GITHUB_RUNNER_NAME=github-runner-i \
-e GITHUB_REPO_URL=https://github.com/mattsbanner/docker-github-runner \
-e GITHUB_TOKEN=NF39244FHF73KJFHFF38FVN92HVCC \
-v /home/docker/volumes/github-runner/:/home/github/data \
mattbanner/github-runner:latest
version: '3.5'
services:
github-runner:
image: mattbanner/github-runner:latest
environment:
- GITHUB_RUNNER_NAME=github-runner-i
- GITHUB_REPO_URL=https://github.com/mattsbanner/docker-github-runner
- GITHUB_TOKEN=NF39284FHF73KJFHFN38FVN92HVCC
volumes:
- /home/docker/volumes/github-runner/:/home/github/data
If you would like to access the host Docker daemon from within the runner container, you will need to mount the socket as a volume.
/var/run/docker.sock:/var/run/docker.sock
The directory /home/github/data/ within the container should be mounted as a volume to persist the data. The GitHub token is only valid for 60 minutes. If you do not mount this volume, you will need to provide a new token every time the container restarts.
GitHub do not recommend using self-hosted runners with Public repositories. You can read their do's and dont's here.
Currently I only have a Ubuntu based image. However this may change down the line. Please feel free to contribute if you feel it would be of benefit.
Images are all built in the DockerHub Cloud to make development a little quicker. Images will be tagged with the release tags created within GitHub. You can browse the DockerHub tags here.
The master branch will be the stable release and will tag as latest on DockerHub. The develop branch will tag as develop.
Content type
Image
Digest
Size
271.2 MB
Last updated
over 6 years ago
docker pull mattbanner/github-runner