A production-ready Docker image for running GitHub Actions on your own infrastructure. Supports x64 architectures with optional SonarScanner integration.
✅ GitHub Actions Compatible - Full support for GitHub Actions workflows
✅ SonarQube Scanner - Optional integrated SonarScanner for code quality analysis
✅ Auto-Configuration - Automatic setup with GitHub registration tokens
✅ Health Checks - Built-in health monitoring
✅ Persistent Storage - Docker volume support for runner data
✅ Secure - Runs as unprivileged user by default
repo scopeGet the docker-compose.yml and .env.example files:
curl -O https://raw.githubusercontent.com/ruriazz/gh-runner-kit/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/ruriazz/gh-runner-kit/main/.env.example
cp .env.example .env
Edit .env with your GitHub credentials:
GITHUB_REPOSITORY=your-org/your-repo
GITHUB_TOKEN=ghp_your_personal_access_token_here
RUNNER_NAME=self-hosted-runner
RUNNER_LABELS=self-hosted,linux,x64
Get your GitHub Token:
repo (full control of private repositories).envdocker-compose up -d
Check logs:
docker-compose logs -f github-runner
Check your GitHub repository settings:
services:
github-runner:
image: ruriazz/gh-runner-kit:${IMAGE_TAG:-beta}
container_name: github-runner
restart: unless-stopped
environment:
# GitHub Configuration (REQUIRED)
GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}
GITHUB_TOKEN: ${GITHUB_TOKEN}
# Runner Configuration (OPTIONAL)
RUNNER_NAME: ${RUNNER_NAME:-self-hosted-runner}
RUNNER_LABELS: ${RUNNER_LABELS:-self-hosted,linux,x64}
RUNNER_WORKDIR: ${RUNNER_WORKDIR:-_work}
# SonarQube Configuration (OPTIONAL - only needed if INSTALL_SONAR=true)
SONAR_HOST_URL: ${SONAR_HOST_URL:-}
SONAR_TOKEN: ${SONAR_TOKEN:-}
# Advanced Options
RUNNER_ALLOW_RUNASROOT: ${RUNNER_ALLOW_RUNASROOT:-false}
DISABLE_AUTO_UPDATE: ${DISABLE_AUTO_UPDATE:-false}
volumes:
# Persist runner data across restarts
- runner-data:/actions-runner/_work
# Optional: Mount Docker socket if workflows need Docker
# - /var/run/docker.sock:/var/run/docker.sock
# Optional: Mount additional workspace directories
# - ./workspace:/workspace
# Optional: Network configuration
# networks:
# - runner-network
volumes:
runner-data:
driver: local
# Optional: Custom network
# networks:
# runner-network:
# driver: bridge
| Variable | Description | Example |
|---|---|---|
GITHUB_REPOSITORY | Repository in format owner/repo | octocat/Hello-World |
GITHUB_TOKEN | GitHub Personal Access Token | ghp_xxxxxxxxxxxx |
| Variable | Default | Description |
|---|---|---|
RUNNER_VERSION | 2.330.0 | GitHub Actions Runner version |
RUNNER_NAME | self-hosted-runner | Unique runner identifier |
RUNNER_LABELS | self-hosted,linux,x64 | Comma-separated labels |
RUNNER_WORKDIR | _work | Working directory for jobs |
INSTALL_SONAR | false | Enable SonarScanner installation |
SONAR_SCANNER_VERSION | 8.0.1.6346 | SonarScanner version |
SONAR_HOST_URL | `` | SonarQube server URL |
SONAR_TOKEN | `` | SonarQube authentication token |
RUNNER_ALLOW_RUNASROOT | false | Allow runner as root user |
DISABLE_AUTO_UPDATE | false | Disable automatic updates |
Add to your .env:
INSTALL_SONAR=true
SONAR_HOST_URL=https://sonarqube.example.com
SONAR_TOKEN=your_sonar_token_here
SONAR_SCANNER_VERSION=8.0.1.6346
RUNNER_VERSION=2.329.0
Uncomment in docker-compose.yml:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Uncomment the network section in docker-compose.yml:
networks:
runner-network:
driver: bridge
Once registered, use the runner in your workflows:
name: Build and Test
on: [push, pull_request]
jobs:
build:
runs-on: self-hosted # Uses your custom runner
steps:
- uses: actions/checkout@v3
- name: Run tests
run: npm test
Target specific runner:
runs-on: [self-hosted, linux, x64]
docker-compose logs -f github-runner
docker-compose stop
docker-compose restart
docker-compose down -v
This will also deregister the runner from GitHub.
The image includes health monitoring that checks if the runner process is active every 30 seconds. View health status:
docker ps --filter "name=github-runner"
Look for (healthy) or (unhealthy) status.
Check logs:
docker-compose logs github-runner
Common issues:
Invalid GitHub Token
repo scopeowner/repoToken Permissions (Organization Repos)
admin:org scopeNetwork Issues
docker psdocker-compose restartdocker exec github-runner df -hVerify volumes have proper permissions:
docker exec github-runner ls -la /actions-runner/
⚠️ Important:
.env with real tokens to version controlrunner user by defaultArchitecture is auto-detected during build.
This image is based on the official GitHub Actions Runner.
For issues and questions:
Version: beta
Last Updated: December 2025
Content type
Image
Digest
sha256:6de7b6711…
Size
528.2 MB
Last updated
9 months ago
docker pull ruriazz/gh-runner-kit:beta