|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Repository Overview |
| 6 | + |
| 7 | +This repository contains Docker images for GitHub Actions self-hosted runners with additional tools pre-installed. The main image is based on the official GitHub Actions runner image and includes Python, PowerShell, Azure CLI, AzCopy, and Ansible. |
| 8 | + |
| 9 | +## Architecture |
| 10 | + |
| 11 | +- **Base Image**: Built on `ghcr.io/actions/actions-runner:2.327.1` |
| 12 | +- **Additional Tools**: Multiple tools installed via a YAML-driven setup system |
| 13 | +- **Setup System**: Uses `setup.yaml` to define installation steps with `setup.sh` orchestrator |
| 14 | +- **Multi-Architecture Support**: Supports both AMD64 and ARM64 architectures |
| 15 | +- **CI/CD**: Uses GitHub Actions for automated building and releasing |
| 16 | + |
| 17 | +## Key Commands |
| 18 | + |
| 19 | +### Building the Docker Image |
| 20 | + |
| 21 | +```bash |
| 22 | +# Build locally |
| 23 | +docker build -t github-actions-runner -f src/Dockerfile src/ |
| 24 | + |
| 25 | +# Build with specific platform |
| 26 | +docker buildx build --platform linux/amd64 -t github-actions-runner -f src/Dockerfile src/ |
| 27 | +``` |
| 28 | + |
| 29 | +### Adding New Tools |
| 30 | + |
| 31 | +To add a new tool to the image: |
| 32 | +1. Create an installation script in `src/scripts/` (e.g., `install-newtool.sh`) |
| 33 | +2. Add a step to `src/setup.yaml`: |
| 34 | + ```yaml |
| 35 | + - name: "Install New Tool" |
| 36 | + script: "scripts/install-newtool.sh" |
| 37 | + description: "Description of what this installs" |
| 38 | + ``` |
| 39 | + OR use inline commands: |
| 40 | + ```yaml |
| 41 | + - name: "Install New Tool" |
| 42 | + command: "apt-get install -y newtool" |
| 43 | + description: "Description of what this installs" |
| 44 | + ``` |
| 45 | +
|
| 46 | +### GitHub Actions Workflow |
| 47 | +
|
| 48 | +The repository uses GitVersion for semantic versioning. The pipeline is triggered on: |
| 49 | +- Push to any branch |
| 50 | +- Pull requests |
| 51 | +- Manual workflow dispatch |
| 52 | +
|
| 53 | +## Project Structure |
| 54 | +
|
| 55 | +- `src/Dockerfile`: Main Dockerfile that builds the runner image |
| 56 | +- `src/setup.yaml`: YAML configuration defining all installation steps |
| 57 | +- `src/setup.sh`: Main orchestrator that reads setup.yaml and executes steps |
| 58 | +- `src/scripts/`: Installation scripts for various tools |
| 59 | + - `install-python.sh`: Installs Python3, pip, pip3, and pipx |
| 60 | + - `install-powershell.sh`: Installs PowerShell Core |
| 61 | + - `install-azure-cli.sh`: Installs Azure CLI |
| 62 | + - `install-azcopy.sh`: Installs AzCopy with architecture detection |
| 63 | +- `.github/workflows/pipeline.yaml`: Main CI/CD pipeline |
| 64 | +- `GitVersion.yaml`: Semantic versioning configuration |
| 65 | + |
| 66 | +## Versioning Strategy |
| 67 | + |
| 68 | +The project uses GitVersion with: |
| 69 | +- Main branch: Continuous deployment mode |
| 70 | +- Develop branch: Minor version increments |
| 71 | +- Release branches: RC pre-releases |
| 72 | +- Feature branches: Named pre-releases |
| 73 | +- Commit messages control version bumps (+semver:major/minor/patch) |
| 74 | + |
| 75 | +## Container Registries |
| 76 | + |
| 77 | +Images are published to: |
| 78 | +- Docker Hub: `emberstack/github-actions-runner` |
| 79 | +- GitHub Container Registry: `ghcr.io/emberstack/github-actions-runner` |
| 80 | + |
| 81 | +Both registries receive multi-architecture manifests supporting AMD64 and ARM64. |
0 commit comments