See for more GitHub repo sf-github-runner
You no longer need an /actions-runner entry in the root of the host file system.
The stock runner expects its externals on the host at /actions-runner/externals.
This repository removes that need.
The externals can now live at any absolute host path.
The repository builds a Docker image for a self-hosted GitHub Actions runner.
It uses a patched runner on top of the myoung34/github-runner image.
A container job gets the runner externals mounted at /__e.
These hold the Node.js runtimes that JavaScript actions need.
The stock runner uses its own install path as the mount source.
The runner uses the Docker daemon of the host.
That daemon looks up the path on the host, not in the runner container.
So the host must provide /actions-runner/externals.
This fork lets you pick another host path.
Inside the job container the path stays /__e.
The actions-runner/ submodule is a fork of actions/runner.
The fork is scanframe-org/actions-runner.
externals-via-envc3a2cb11bab309799230e51c9089b0dc1748eb24Show the changes with:
git -C actions-runner diff main...
The fork adds the optional RUNNER_EXTERNALS_HOST_PATH environment variable.
Runner.Worker/ContainerOperationProvider.cs:
externals mount./__e.Runner.Worker/Handlers/StepHost.cs:
/actions-runner/externals/node24/bin/node is translated to /__e/node24/bin/node./foo/bar2 no longer matches /foo/bar.Runner.Worker/Handlers/NodeScriptActionHandler.cs:
Tests:
ContainerOperationProviderL0.cs covers the default, the override, invalid paths and unaffected mounts.StepHostL0.cs covers path translation with a custom mount source.This repository pins the submodule commit. Update the submodule reference to move to another fork revision.
actions-runner/: the pinned runner fork.runner/Dockerfile: replaces /actions-runner in the base image with the built _layout.runner/job-started.sh: runner hook, mounted into the container by build.sh.build.sh: builds, publishes and runs the runner.Run ./build.sh --help for all commands.
Settings are read from a local .credentials file.
The script creates a template when the file is missing.
Do not commit this file.
Required:
GITHUB_PATGITHUB_ORGGITHUB_RUNNER_NAMEOptional:
RUNNER_LABELS (defaults to sf-build)NEXUS_REPOSITORY for the private registryDOCKER_USER for Docker Hubrunner: builds the runner into actions-runner/_layout.
It calls dev.sh and defaults to layout Release linux-x64.image: builds the Docker image.
It first checks that the base image tag matches src/runnerversion.
It also checks that the _layout is complete.build-image: runs runner and then image.clean: removes build output and the _layout, _dotnetsdk and _downloads directories.The image is tagged amd64/github-runner:<runner version>.
It also gets a tag for the private registry.
push and pull: use the private registry.docker-push: pushes the versioned image to Docker Hub.docker-latest: pushes the image to Docker Hub as latest.The externals are taken from the image itself.
No host install of the runner is needed.
zip-file: exports /actions-runner/externals from the image.
It writes /tmp/runner-externals.zip.zip-mount: mounts the zip file at /tmp/runner-externals using fuse-zip.zip-umount: unmounts it again.run: runs the runner in the foreground.
The runner is ephemeral and stops after one job.start: runs the runner in the background.
It restarts unless stopped.do-run: runs zip-file, zip-mount and then run in a loop.do-start: runs zip-file, zip-mount and then start.The script picks the externals source in this order:
/tmp/runner-externals/externals./tmp/runner-externals/externals when it is empty or missing.
In this case /tmp/runner-externals itself is mounted./actions-runner/externals on the host.The chosen path is passed as RUNNER_EXTERNALS_HOST_PATH.
It is mounted at the same path in the runner container.
The script warns when node24/bin/node is missing there.
The runner container also gets:
/tmp/<runner name>.job-started.sh hook.DEBUG_OUTPUT=true and ACTIONS_RUNNER_DEBUG=true.
So the mount diagnostics show up in the job debug output.status: shows the container.do-status: shows the status every second.stop, kill and remove: manage the container.attach: opens a Bash shell in the container.exec: runs a command in the container.inspect: shows RUNNER_EXTERNALS_HOST_PATH and the mounts of the container../build.sh runner
./build.sh image
./build.sh push
./build.sh do-start
The Docker daemon creates the job container.
So the externals path must exist for that daemon.
It must exist at the same absolute path in two places:
Example: /var/lib/actions-runner/externals must exist at that exact path in both.
The job container still gets it at /__e.
Content type
Image
Digest
sha256:ddc2ffc37…
Size
954.7 MB
Last updated
about 3 hours ago
docker pull avolphen/amd64-github-runner