Skip to content

Commit 10dc91d

Browse files
committed
feat(docs): enhance documentation of included tools and optimizations
- Updated repository overview to reflect a comprehensive suite of included development and operations tools. - Added details about pre-installed tools in the base image to avoid redundant installations. - Introduced best practices for tool installation and verification to improve efficiency and maintainability. - Changed JSON/YAML tools installation script to a verification script, confirming the availability of pre-installed tools. This enhances clarity for users regarding the environment setup processes.
1 parent 04928f7 commit 10dc91d

7 files changed

Lines changed: 79 additions & 28 deletions

File tree

CLAUDE.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Repository Overview
66

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.
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 a comprehensive suite of development and operations tools including Python, PowerShell, Node.js, .NET SDK, Azure CLI, AzCopy, Ansible, Kubernetes tools, network utilities, and more.
88

99
## Architecture
1010

@@ -108,10 +108,22 @@ The repository uses GitVersion for semantic versioning. The pipeline is triggere
108108
- `src/setup.yaml`: YAML configuration defining all installation steps
109109
- `src/setup.sh`: Main orchestrator that reads setup.yaml and executes steps
110110
- `src/scripts/`: Installation scripts for various tools
111-
- `install-python.sh`: Installs Python3, pip, pip3, and pipx
111+
- `install-coreutils.sh`: Verifies GNU coreutils (pre-installed)
112+
- `install-file-tools.sh`: Installs file utilities (file, tree, time)
113+
- `install-archive-tools.sh`: Installs compression tools (p7zip, zip)
114+
- `install-python.sh`: Installs pip and Python development tools
112115
- `install-powershell.sh`: Installs PowerShell Core
116+
- `install-nodejs.sh`: Installs Node.js and npm
113117
- `install-azure-cli.sh`: Installs Azure CLI
114118
- `install-azcopy.sh`: Installs AzCopy with architecture detection
119+
- `install-ansible.sh`: Installs Ansible via pip
120+
- `install-docker-tools.sh`: Installs Docker Compose plugin
121+
- `install-json-tools.sh`: Verifies jq and yq tools
122+
- `install-kubernetes-tools.sh`: Installs kubectl, helm, kustomize
123+
- `install-yamllint.sh`: Installs yamllint
124+
- `install-github-cli.sh`: Installs GitHub CLI
125+
- `install-dotnet-sdk.sh`: Installs .NET SDK (LTS and latest)
126+
- `install-network-tools.sh`: Installs comprehensive network utilities
115127
- `.github/workflows/pipeline.yaml`: Main CI/CD pipeline
116128
- `GitVersion.yaml`: Semantic versioning configuration
117129

@@ -158,4 +170,28 @@ When debugging tool installations:
158170
1. Check the colored output from `setup.sh` for the specific failing step
159171
2. Run the Docker build with `--progress=plain` for detailed output
160172
3. Test scripts individually inside a running container
161-
4. Verify architecture-specific logic for ARM64 vs AMD64
173+
4. Verify architecture-specific logic for ARM64 vs AMD64
174+
175+
## Base Image Optimization
176+
177+
The base GitHub Actions runner image already includes many common tools. Before adding new tools, check if they're pre-installed:
178+
179+
### Pre-installed Tools (Do Not Re-install)
180+
- **Core utilities**: curl, wget, git, tar, unzip, sudo
181+
- **Python 3**: Python interpreter (but not pip)
182+
- **Docker**: Docker engine with Docker Buildx
183+
- **JSON processing**: jq
184+
- **SSH tools**: ssh, scp, openssh-client
185+
- **Build essentials**: gcc, make, build-essential
186+
187+
### Verification Scripts
188+
Some scripts only verify pre-installed tools rather than installing them:
189+
- `install-coreutils.sh`: Verifies GNU coreutils
190+
- `install-json-tools.sh`: Verifies jq (pre-installed) and yq (installed in Dockerfile)
191+
192+
### Installation Best Practices
193+
1. Always check if a tool is pre-installed before adding installation logic
194+
2. Use verification-only scripts for pre-installed tools
195+
3. Group related tools in single installation scripts
196+
4. Minimize apt-get update calls by grouping installations
197+
5. Clean package caches after installation to reduce image size

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ docker run -d \
4040

4141
## Included Software
4242

43+
### Pre-installed in Base Image
44+
The following tools are already available in the GitHub Actions runner base image:
45+
- **Python 3** - Python interpreter
46+
- **Git** - Version control system
47+
- **Docker** with **Docker Buildx** - Container platform
48+
- **jq** - JSON processor
49+
- **curl** - Data transfer tool
50+
- **SSH/SCP** - Secure shell and copy
51+
- **tar** - Archive utility
52+
- **unzip** - ZIP extraction
53+
- **sudo** - Privilege escalation
54+
- **Core Unix tools** - find, grep, sed, awk, perl, etc.
55+
4356
### Core Utilities
4457
- **GNU Coreutils** - Essential Unix utilities (ls, cp, mv, cat, etc.)
4558
- **File Utilities**
@@ -71,15 +84,16 @@ docker run -d \
7184
- **Kustomize** - Kubernetes configuration management (latest)
7285

7386
### Development Tools
74-
- **Git** - Version control (latest from official PPA)
87+
- **Git** - Version control (pre-installed in base image)
7588
- **GitHub CLI** (`gh`) - GitHub operations (latest)
76-
- **jq** - JSON processor
89+
- **jq** - JSON processor (pre-installed in base image)
7790
- **yq** - YAML processor (latest)
7891
- **yamllint** - YAML linter (latest from pip)
7992

8093
### Archive & Compression Tools
81-
- **tar** - Tape archive utility
82-
- **zip/unzip** - ZIP archive utilities
94+
- **tar** - Tape archive utility (pre-installed in base image)
95+
- **unzip** - ZIP decompression (pre-installed in base image)
96+
- **zip** - ZIP compression
8397
- **p7zip-full** (7z) - 7-Zip archiver
8498

8599
### Network Tools
@@ -98,8 +112,8 @@ docker run -d \
98112
- `netstat` - Network statistics
99113
- `route` - Routing table manipulation
100114
- **Connection Tools**
101-
- `ssh` - Secure Shell client
102-
- `scp` - Secure copy
115+
- `ssh` - Secure Shell client (pre-installed in base image)
116+
- `scp` - Secure copy (pre-installed in base image)
103117
- `ftp` - File Transfer Protocol client
104118
- `telnet` - Telnet client
105119
- `netcat` (`nc`) - Network debugging

src/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ FROM ghcr.io/actions/actions-runner:2.327.1
33
USER root
44

55
# Install required dependencies
6+
# Note: curl is already in base image, but wget is needed
67
RUN apt-get update && \
78
apt-get install -y --no-install-recommends \
89
wget \
9-
curl \
1010
ca-certificates \
1111
&& rm -rf /var/lib/apt/lists/*
1212

src/scripts/install-json-tools.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
#!/bin/bash
22

3-
# Install jq (yq is already installed in the Dockerfile)
3+
# Verify JSON/YAML tools
4+
# Note: Both jq and yq are already available
5+
# - jq is pre-installed in the base image
6+
# - yq is installed in the Dockerfile
47

5-
echo "Installing JSON/YAML tools..."
8+
echo "Verifying JSON/YAML tools..."
69

7-
# Install jq
8-
apt-get update
9-
apt-get install -y --no-install-recommends jq
10-
11-
# Verify jq installation
12-
echo "Verifying jq installation..."
10+
# Verify jq is available (pre-installed in base image)
11+
echo "Checking jq installation..."
1312
if ! command -v jq &> /dev/null; then
14-
echo "ERROR: jq command not found after installation"
13+
echo "ERROR: jq command not found (should be pre-installed)"
1514
exit 1
1615
fi
1716
echo "jq version:"
1817
jq --version
1918

2019
# Verify yq is available (installed in Dockerfile)
21-
echo "Verifying yq installation..."
20+
echo ""
21+
echo "Checking yq installation..."
2222
if ! command -v yq &> /dev/null; then
2323
echo "ERROR: yq command not found"
2424
exit 1
2525
fi
2626
echo "yq version:"
2727
yq --version
2828

29-
echo "JSON/YAML tools installation completed successfully!"
29+
echo ""
30+
echo "JSON/YAML tools verification completed successfully!"

src/scripts/install-network-tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
echo "Installing network tools..."
66

77
# Install network packages
8+
# Note: openssh-client (ssh, scp) is already in base image
89
apt-get update
910
apt-get install -y --no-install-recommends \
1011
dnsutils \
@@ -14,7 +15,6 @@ apt-get install -y --no-install-recommends \
1415
iproute2 \
1516
net-tools \
1617
netcat \
17-
openssh-client \
1818
ftp \
1919
telnet \
2020
sshpass

src/scripts/install-python.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
# Install Python and pip
3+
# Install pip and Python development tools
4+
# Note: Python3 is already installed in the base image
45

5-
# Update packages and install Python3 and pip
6+
# Update packages and install pip and development tools
67
apt-get update
78
apt-get install -y --no-install-recommends \
8-
python3 \
99
python3-pip \
1010
python3-venv \
1111
python3-dev

src/setup.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ setup:
1717

1818
- name: "Install Python and pip"
1919
script: "scripts/install-python.sh"
20-
description: "Installs Python3 and pip"
20+
description: "Installs pip and Python dev tools (Python3 is pre-installed)"
2121

2222
- name: "Install PowerShell"
2323
script: "scripts/install-powershell.sh"
@@ -43,9 +43,9 @@ setup:
4343
script: "scripts/install-docker-tools.sh"
4444
description: "Installs Docker Compose plugin"
4545

46-
- name: "Install JSON/YAML tools"
46+
- name: "Verify JSON/YAML tools"
4747
script: "scripts/install-json-tools.sh"
48-
description: "Installs jq (yq is already installed)"
48+
description: "Verifies jq (pre-installed) and yq (installed in Dockerfile)"
4949

5050
- name: "Install Kubernetes tools"
5151
script: "scripts/install-kubernetes-tools.sh"

0 commit comments

Comments
 (0)