Run self-hosted GitHub Runners in docker with resource limitations and scalability.
  • Dockerfile 71.5%
  • Shell 28.5%
Find a file
2025-08-18 21:22:12 -04:00
.github fix: rename ci workflow to correct name 2025-08-18 12:54:04 -04:00
docker-compose.yml feat: add docker sock volume and required permissions for dind 2025-08-18 21:22:12 -04:00
Dockerfile feat: install docker 2025-08-18 21:21:47 -04:00
README.md feat: create readme 2025-08-18 13:32:30 -04:00
SECURITY.md feat: create security.md 2025-08-18 13:39:23 -04:00
start.sh feat: add runner suffix to runner name in start script 2025-08-18 13:14:49 -04:00

Dockerized GitHub Runner

This project aims to simplify the process of making a self hosted action runner by allowing the user to neatly limit system resources, ensure constant up-time, and enhance scalability.

Roadmap

  • Generate custom name, if not provided one, with helpful information like host, region, and platform.
  • Structured logs (this is primarely just an idea and may not even be implemented)

Capabilities

Currently only Linux is supported, however Mac and Windows will be soon also supported.

  • Custom runner name (with randomly generated suffix to ensure uniqueness when horizontally scaling)
  • Automatic clean-up
  • Organization Runner
  • Personal Repository Runner

Getting Started

Per the docker-compose.yml file, use this template and fill-in the environment variables.

You can grab your runner token by going to your organization or personal repository Settings page, clicking on Actions and Runners, then New self-hosted runner.

Your token should in the Configure box. ex:

Configure

./config.sh --url https://github.com/maxpeterkaya/docker-runner --token YOUR_TOKEN

Copy YOUR_TOKEN then to the environment variable in the docker-compose file.

services:
  runner:
    image: ghcr.io/maxpeterkaya/docker-runner:latest
    restart: always
    environment:
      - OWNER= # This can be just an org or a repo, eg. ORG: github | REPO: maxpeterkaya/docker-runner
      - TOKEN= # This is your token you recieve from github when creating a new self hosted runner
      - NAME=  # This is your runner's name for easier distinction
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
        reservations:
          cpus: '0.3'
          memory: 256M

Refer to the docker compose reference for more details about the resources configuration.