ARM Runners for GitHub Actions
Overview
When building Docker images for multiple architectures (particularly ARM64/linux/arm64), you have two options:
- Cross-compilation - Build ARM64 images on x86_64 runners (default)
- Native compilation - Build ARM64 images on native ARM64 runners
Current Workflow Behavior
Our Docker build workflow is configured to:
- Build images for both architectures:
linux/amd64
andlinux/arm64
- Default: Build all images on x86_64 hosts regardless of target architecture (cross-compilation)
- Upload individual architecture images to Artifactory (no tags, just digest)
- Combine them into a manifest list with appropriate tags
Why ARM Runners?
GitHub's Limitations
- GitHub's shared Linux ARM runners are only available for public repositories
- Private repositories need to provision their own ARM runners for native builds
Benefits of Native ARM Builds
- Faster build times for ARM64 images (no emulation overhead)
- Better compatibility with some ARM-specific dependencies
- Reduced resource usage compared to cross-compilation
How to Provision ARM Runners
Prerequisites
- GitHub repository with Actions enabled
- ARM64 host machine (physical or cloud instance)
- Repository admin permissions
Steps
-
Prepare ARM64 Host
# On your ARM64 machine (e.g., AWS Graviton, Apple Silicon, etc.)
# Install Docker and other dependencies
sudo apt update && sudo apt install -y docker.io -
Register Runner
- Go to your GitHub repository → Settings → Actions → Runners
- Click "New self-hosted runner"
- Select "Linux" and "ARM64"
- Follow the provided commands to download and configure the runner
-
Configure Runner
# Download runner (use the specific URL from GitHub)
curl -o actions-runner-linux-arm64-2.x.x.tar.gz -L https://github.com/actions/runner/releases/download/v2.x.x/actions-runner-linux-arm64-2.x.x.tar.gz
# Extract and configure
tar xzf ./actions-runner-linux-arm64-2.x.x.tar.gz
./config.sh --url https://github.com/your-org/your-repo --token YOUR_TOKEN -
Install as Service
sudo ./svc.sh install
sudo ./svc.sh start
Using ARM Runners in Workflows
Default Behavior (Cross-compilation)
# No additional configuration needed
# All builds happen on x86_64 runners
Native ARM Builds
# Override the default in your workflow
# Pass values to enable native ARM builds
build:
uses: ./.github/workflows/docker-build.yml
with:
use_native_arm: true # Example parameter
Key Differences
Aspect | Cross-compilation (Default) | Native ARM Builds |
---|---|---|
Setup | No additional setup required | Requires provisioned ARM runner |
Build Speed | Slower for ARM64 images | Faster for ARM64 images |
Resource Usage | Higher CPU usage on x86_64 | Distributed across architectures |
Compatibility | May have edge cases | Better compatibility |
Cost | Uses existing runners | Additional runner infrastructure |
When to Use Native ARM Runners
Consider provisioning ARM runners when:
- You have frequent ARM64 builds
- Build times are critical
- You encounter ARM-specific compatibility issues
- Your project has ARM-specific dependencies
Troubleshooting
Common Issues
- Runner not appearing: Check network connectivity and firewall rules
- Build failures: Ensure Docker is properly installed and configured
- Permission errors: Verify runner service has appropriate permissions
Debug Commands
# Check runner status
sudo ./svc.sh status
# View runner logs
sudo journalctl -u actions.runner.your-org-your-repo.your-runner