github-actions-runner
Enhanced GitHub Actions self-hosted runner with comprehensive development tools
2.0K
This repository provides enhanced Docker images for GitHub Actions self-hosted runners with a comprehensive suite of pre-installed development and operations tools. Built on top of the official GitHub Actions runner base image, it includes essential tools for CI/CD workflows, making it ideal for enterprise and development environments.
docker pull emberstack/github-actions-runner:latest
docker pull ghcr.io/emberstack/github-actions-runner:latest
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_NAME="my-runner" \
-e GITHUB_RUNNER_LABELS="docker,linux" \
emberstack/github-actions-runner:latest
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_TOKEN="your-registration-token" \
-e GITHUB_RUNNER_NAME="my-runner" \
emberstack/github-actions-runner:latest
docker run -d \
--name github-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_DOCKER_SOCK="true" \
emberstack/github-actions-runner:latest
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_GID="1001" \
emberstack/github-actions-runner:latest
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_EPHEMERAL="true" \
emberstack/github-actions-runner:latest
The GITHUB_RUNNER_NAME supports safe environment variable expansion, allowing dynamic runner names based on any runtime environment variable:
# Use container hostname (container ID in Docker)
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_NAME='$HOSTNAME' \
emberstack/github-actions-runner:latest
# Combine with prefix/suffix
docker run -d \
--name github-runner \
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
-e GITHUB_RUNNER_NAME='runner-$HOSTNAME' \
emberstack/github-actions-runner:latest
# Use in Docker Compose with custom hostname
services:
runner:
image: emberstack/github-actions-runner:latest
hostname: worker-node-1
environment:
GITHUB_RUNNER_URL: "https://github.com/your-org/your-repo"
GITHUB_RUNNER_PAT: "your-personal-access-token"
GITHUB_RUNNER_NAME: 'runner-$HOSTNAME' # Will be "runner-worker-node-1"
Examples of Supported Variables:
$HOSTNAME or ${HOSTNAME} - The container's hostname (container ID by default in Docker)$USER or ${USER} - The current user (typically "runner")$HOME or ${HOME} - The user's home directory$PATH - System PATHNote: Use single quotes (') to prevent variable expansion on the host shell, allowing expansion inside the container. Variable expansion is performed safely using envsubst, preventing code injection.
In ephemeral mode, the runner will:
GITHUB_RUNNER_URL (required): Repository, organization, or enterprise URLGITHUB_RUNNER_PAT or GITHUB_RUNNER_TOKEN (required): Authentication tokenGITHUB_RUNNER_NAME (optional): Runner name (defaults to hostname). Supports safe environment variable expansion using standard shell syntaxGITHUB_RUNNER_LABELS (optional): Comma-separated list of labelsGITHUB_RUNNER_GROUP (optional): Runner group nameGITHUB_RUNNER_WORKDIR (optional): Working directory for jobsGITHUB_RUNNER_GID (optional): Custom GID to create github-actions-runner groupGITHUB_RUNNER_DOCKER_SOCK (optional): Set to "true" to auto-configure Docker socket accessGITHUB_RUNNER_DOCKER_SOCK_GID (optional): Explicit GID for Docker socket group (overrides auto-detection when socket exists)GITHUB_RUNNER_EPHEMERAL (optional): Set to "true" to configure runner in ephemeral mode (single job only)The following environment variables are set in the Docker image:
DOTNET_INSTALL_DIR: Set to /home/runner/.dotnet to avoid permission issues when using actions/setup-dotnetThe container handles shutdown signals (SIGTERM, SIGINT) gracefully:
This automatic cleanup prevents orphaned runner registrations when containers are stopped.
The following tools are already available in the GitHub Actions runner base image:
gh) - GitHub operations (latest)dig - DNS lookupnslookup - Query DNS serversnsupdate - Dynamic DNS updatesping - Network connectivity testtracepath - Network path discoveryarping - ARP level pingip - Show/manipulate routing, network devicesss - Socket statisticsifconfig - Network interface configurationnetstat - Network statisticsroute - Routing table manipulationssh - Secure Shell client (pre-installed in base image)scp - Secure copy (pre-installed in base image)ftp - File Transfer Protocol clienttelnet - Telnet clientnetcat (nc) - Network debuggingsshpass - Non-interactive SSH authenticationThe image uses a YAML-driven installation system:
src/setup.yaml - Defines installation stepssrc/setup.sh - Orchestrates the installation processsrc/scripts/ - Individual installation scripts for each tool groupdocker build -t github-actions-runner -f src/Dockerfile src/
docker buildx build --platform linux/amd64 -t github-actions-runner -f src/Dockerfile src/
docker buildx build --platform linux/amd64,linux/arm64 -t github-actions-runner -f src/Dockerfile src/
src/scripts/:#!/bin/bash
# src/scripts/install-newtool.sh
apt-get update
apt-get install -y newtool
# Add verification
if ! command -v newtool &> /dev/null; then
echo "ERROR: newtool installation failed"
exit 1
fi
src/setup.yaml:- name: "Install New Tool"
script: "scripts/install-newtool.sh"
description: "Description of the tool"
chmod +x src/scripts/install-newtool.sh
The repository uses GitHub Actions for automated building and releasing:
feat: - Minor version bumpfix: - Patch version bumpfeat!: or +semver:major - Major version bumpāāā .github/
ā āāā workflows/
ā āāā pipeline.yaml # CI/CD pipeline
āāā src/
ā āāā Dockerfile # Main Docker image definition
ā āāā setup.yaml # Tool installation configuration
ā āāā setup.sh # Installation orchestrator
ā āāā scripts/ # Individual tool installation scripts
āāā GitVersion.yaml # Semantic versioning configuration
āāā LICENSE # Repository license
āāā README.md # This file
āāā CLAUDE.md # AI assistant guidance
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSEā file for details.
While installation scripts for various development tools are available in the src/_archive/scripts/ directory, we recommend using GitHub Actions' official setup actions or marketplace actions in your workflows:
actions/setup-pythonā - includes pip by defaultactions/setup-nodeā actions/setup-dotnetā azure/setup-kubectlā azure/setup-helmā imranismail/setup-kustomizeā These actions provide better caching, version management, and are optimized for CI/CD environments.
Content type
Image
Digest
sha256:9731e9260ā¦
Size
756.8 MB
Last updated
5 months ago
Requires Docker Desktop 4.37.1 or later.