sctg/github-runner-vs2010
GitHub runner with VS2010 and SDK 7.1a for Windows XP builds
66
This repository provides a Docker image sctg/github-runner-vs2010:2.321.0
for running a self-hosted GitHub runner with Visual Studio 2010 and Windows SDK 7.1a. The main purpose is to enable building Windows XP-compatible applications, as GitHub's standard runners no longer support Visual Studio 2010 and Microsoft has ended Windows XP support.
Before running the Docker container, you need to configure your GitHub repository to accept self-hosted runners:
Important security considerations:
Runner labels:
Install-WindowsFeature Containers
Install-WindowsFeature Hyper-V
Restart-Computer -Force
# Install Docker
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/master/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -OutFile install-docker-ce.ps1
.\install-docker-ce.ps1
# Start Docker service
Start-Service docker
# Switch to Windows containers
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon
# Test Docker installation
docker version
# Set Docker to use Windows containers by default
[Environment]::SetEnvironmentVariable("DOCKER_DEFAULT_PLATFORM", "windows", "Machine")
When running Windows containers, ensure you use the correct isolation mode:
docker run --isolation=process -it -e GH_TOKEN='your_github_token' -e GH_OWNER='your_github_owner' -e GH_REPOSITORY='your_github_repo' sctg/github-runner-vs2010:2.321.0
[Rest of the README continues as before...]
To build the Docker image, run the following command:
docker build . --tag sctg/github-runner-vs2010:2.321.0 --tag sctg/github-runner-vs2010:latest --push
To run the Docker container, you need to provide the following environment variables:
GH_TOKEN
: Your GitHub Personal Access Token with the minimum required scopes: repo
, read:org
.GH_OWNER
: The owner of the repository (user or organization).GH_REPOSITORY
: The name of the repository.Run the container with the following command:
docker run -it -e GH_TOKEN='your_github_token' -e GH_OWNER='your_github_owner' -e GH_REPOSITORY='your_github_repo' sctg/github-runner-vs2010:2.321.0
To use this runner in your GitHub workflows, you need to specify the runs-on
field with your self-hosted runner label. Here's a sample workflow that builds a Windows XP-compatible application:
name: Build Windows XP App
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: self-hosted # Use your self-hosted runner
steps:
- uses: actions/checkout@v3
- name: Setup MSBuild
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
- name: Build Solution
shell: cmd
run: |
msbuild YourSolution.sln /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v100 /p:WindowsTargetPlatformVersion=7.1A
- name: Run Tests
shell: cmd
run: |
vstest.console.exe ./path/to/tests.dll
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: windows-xp-build
path: path/to/your/build/output/**
Note: Replace YourSolution.sln
and paths with your actual project files and build output locations.
The Dockerfile sets up the environment with:
The start.ps1
script handles the container initialization by:
GH_TOKEN
Common issues and solutions:
Runner Registration Fails:
Build Failures:
Docker Container Issues:
When the Docker container is stopped, the runner registration is automatically removed from GitHub. However, if you encounter stale runners, you can use the provided Cleanup-Runners.ps1
script:
.\Cleanup-Runners.ps1 -Owner your_github_owner -Repository your_github_repo -Token your_github_token
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU Affero General Public License version 3.
docker pull sctg/github-runner-vs2010