A lightweight, self-hosted GitHub Actions runner packaged as a Docker container using Alpine Linux.
- Minimal Alpine Linux base image
- Multi-stage Docker build for smaller image size
- Easy configuration via environment variables
- Docker Compose support for simple deployment
- Go to your repository on GitHub
- Navigate to Settings > Actions > Runners
- Click New self-hosted runner
- Copy the token from the configuration instructions
# Copy the example compose file
cp docker-compose.yml.example compose.yml
# Edit with your values
nano compose.ymlUpdate the environment variables:
environment:
RUNNER_TOKEN: "your-runner-token"
OWNER: "your-github-username"
REPO: "your-repository-name"Start the runner:
docker compose up -d# Build the image
docker build -t github-runner .
# Run the container
docker run -d \
-e RUNNER_TOKEN="your-token" \
-e OWNER="your-username" \
-e REPO="your-repo" \
--name github-runner \
github-runner| Variable | Required | Description |
|---|---|---|
RUNNER_TOKEN |
Yes | GitHub runner registration token |
OWNER |
Yes | GitHub username or organization name |
REPO |
Yes | Repository name |
.
├── Dockerfile # Multi-stage build configuration
├── docker-compose.yml.example # Compose template
├── entrypoint.sh # Runner configuration and startup script
└── README.md
The image uses a two-stage build process:
- Builder stage: Downloads and extracts the GitHub Actions runner
- Runtime stage: Minimal Alpine image with only necessary dependencies