Deploy custom GitHub runner inside a Windows VM
1.3K
Explore an innovative, efficient, and cost-effective approach to deploying a custom GitHub Runner that runs in a containerized Windows OS (x64) environment on a Linux system. This project leverages the robust capabilities of Vagrant VM, libvirt, and docker-compose which allows for seamless management of a Windows instance just like any Docker container. The added value here lies in the creation of a plug-and-play solution, significantly enhancing convenience, optimizing resource allocation, and integrating flawlessly with existing workflows. This strategy enriches CI/CD pipeline experiences in various dev-ops environments, providing a smooth and comprehensive approach that does not require prior knowledge of VM creation.
ā Don't forget to star the project if it helped you!
For the purpose of authenticating your custom self-hosted runners, we offer two viable authentication methods:
Personal Access Token (PAT) - The Personal Access Token is a static, manually created token that provides secure access to GitHub. This offers a long-lived method of authentication (The PAT token needs Read and Write access to organization self-hosted runners).
Registration Token (TOKEN) - The Registration Token is a dynamic, short-lived token generated automatically by GitHub during the creation of a new self-hosted runner. This provides a temporary but immediate method of authentication.
Note: Only one of these authentication methods is necessary. Choose the method that best fits your
.envPAT: Personal access token from GitHubTOKEN: Short lived Github tokenRUNNER_URL: The URL of the GitHub that the runner connects toRUNNERS: Number of runnersMEMORY: Amount of memory for the Vagrant image (in MB)CPU: Number of CPUs for the Vagrant imageDISK_SIZE: Disk size for the Vagrant image (in GB)# Runner settings
PAT=<Your Personal access token>
RUNNER_URL=<runner url>
RUNNERS=1
# Vagrant image settings
MEMORY=8000 # 8GB
CPU=4
DISK_SIZE=100
# Runner settings
TOKEN=<Your short lived acess token>
RUNNER_URL=<runner url>
RUNNERS=1
# Vagrant image settings
MEMORY=8000 # 8GB
CPU=4
DISK_SIZE=100
docker-compose.ymlversion: "3.9"
services:
windows-github-runner-vm:
image: docker.io/vaggeliskls/windows-github-custom-runner:latest
env_file: .env
stdin_open: true
tty: true
privileged: true
ports:
- 3389:3389
docker-compose up -dFor debugging purposes or testing you can always connect to the VM with remote desktop softwares.
Some software that used when developed was
rdesktop <ip>:3389 or reminaā Remote Windows ConnectionThe default users based on vagrant image are
Content type
Image
Digest
sha256:5e176a44dā¦
Size
7.6 GB
Last updated
17 days ago
docker pull vaggeliskls/windows-github-custom-runner