Sign inSign up

mattbanner/github-runner

By mattbanner

•Updated over 6 years ago

GitHub Actions runner within a Docker Container

Image
0

10K+

mattbanner/github-runner repository overview

⁠Dockerised GitHub Runners

Host your own GitHub action runners within Docker.

⁠Setup

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
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
⁠Docker Compose
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

⁠Things to Note

  1. 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
    
  2. 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.

  3. GitHub do not recommend using self-hosted runners with Public repositories. You can read their do's and dont's here⁠.

⁠Releases

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.

Tag summary

Content type

Image

Digest

Size

271.2 MB

Last updated

over 6 years ago

docker pull mattbanner/github-runner