See the official GitHub Actions Runner repository for additional information.
See the Actions Runner Controller release documentation for more information regarding the Dockerfile and how it may be used to produce self-hosted Actions runners. These runners may be used in conjuction with ARC and Kubernetes.
The Dockerfile
in this repository was copied from the official GitHub actions/runner
repository. That Dockerfile may be found here:
https://github.com/actions/runner/blob/main/images/Dockerfile
The Dockerfile requires the following arguments to build an image. Some arguments have defaults specified within the Dockerfile.
Arguments for a Linux image:
TARGETOS=linux
TARGETARCH=amd64
RUNNER_VERSION=2.308.0
RUNNER_CONTAINER_HOOKS_VERSION=0.3.2
DOCKER_VERSION=23.0.6
Run the following command from the project base directory to build a Linux action runner.
TIP: Update the tag name to the desired image name.
docker build \
--build-arg TARGETOS=linux \
--build-arg TARGETARCH=amd64 \
--build-arg RUNNER_VERSION=2.308.0 \
--tag mwarman/gh-actions-runner-linux:latest \
.
This is an example of a pod spec with the init container copying assets to the runner directory.
TIP: Update the YAML with the your pod and image names.
apiVersion: v1
kind: Pod
metadata:
name: <name>
spec:
containers:
- name: runner
image: <image>
command: ['/runner/run.sh']
volumeMounts:
- name: runner
mountPath: /runner
initContainers:
- name: setup
image: <image>
command: ['sh', '-c', 'cp -r /actions-runner/* /runner/']
volumeMounts:
- name: runner
mountPath: /runner
volumes:
- name: runner
emptyDir: {}
GitHub Actions Runner
Action Runner Controller
Producing Runner Images
GitHub Actions Runner Dockerfile