Welcome to the GitHub Self-Hosted Runner Dockerization repository. This project provides a Dockerized solution for setting up a self-hosted GitHub Actions runner.
- Docker Compose Setup: Easily deploy self-hosted runners using Docker Compose.
- Customizable: Use the provided Docker image or build your own using the Dockerfile.
- Scalable: Deploy multiple runner replicas with resource constraints.
- Cross-Platform: Support for Linux, macOS, and Windows environments.
LICENSE: The license file for this project.README.md: The documentation file you are currently reading.docker-compose.yml: The Docker Compose file to deploy the self-hosted runner on Linux.docker-compose.mac.yml: The Docker Compose file to deploy the self-hosted runner on macOS.docker-compose.windows.yml: The Docker Compose file to deploy the self-hosted runner on Windows.Docker Image/: A directory containing the Dockerfiles and start scripts for building the runner images.
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Edit the
docker-compose.ymlfile to specify your repository, registration token, and runner name. -
Deploy the self-hosted runner:
docker-compose up -d
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Edit the
docker-compose.mac.ymlfile to specify your repository, registration token, and runner name. -
Deploy the self-hosted runner:
docker-compose -f docker-compose.mac.yml up -d
-
Prerequisites:
- Install Docker Desktop for Windows
- Enable WSL 2 (Windows Subsystem for Linux)
- Install Ubuntu 20.04 from the Microsoft Store or enable it through PowerShell
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Edit the
docker-compose.windows.ymlfile to specify your repository, registration token, and runner name. -
Deploy the self-hosted runner:
docker-compose -f docker-compose.windows.yml up -d
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Build the Docker image:
cd Docker Image docker build -t custom-github-runner:latest ./ -
Edit the
docker-compose.ymlfile to use your custom image. -
Deploy the self-hosted runner:
docker-compose up -d
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Build the Docker image:
cd Docker Image docker build -t custom-github-runner-mac:latest -f Dockerfile.mac ./ -
Edit the
docker-compose.mac.ymlfile to use your custom image. -
Deploy the self-hosted runner:
docker-compose -f docker-compose.mac.yml up -d
-
Clone the repository:
git clone https://github.com/youssefbrr/self-hosted-runner.git cd self-hosted-runner -
Build the Docker image:
cd Docker Image docker build -t custom-github-runner-windows:latest -f Dockerfile.windows ./ -
Edit the
docker-compose.windows.ymlfile to use your custom image. -
Deploy the self-hosted runner:
docker-compose -f docker-compose.windows.yml up -d
REPO: The GitHub repository to register the runner to (format:<owner>/<repo>).REG_TOKEN: The registration token for the self-hosted runner from the GitHub repository settings.NAME: The name of the self-hosted runner.
For macOS, keep in mind:
- You need to have Docker Desktop for Mac installed and running.
- The macOS runner uses different base images and paths compared to the Linux version.
- Performance may differ from the Linux version due to the virtualization layer.
For Windows, keep in mind:
- You need to have Docker Desktop for Windows installed and running.
- WSL 2 must be enabled and properly configured.
- The Ubuntu 20.04 distribution should be installed through WSL.
- Performance may vary depending on your system's virtualization settings.
- Make sure your Windows system meets the minimum requirements for running Docker Desktop and WSL 2.