This repo contains Dockerfiles for both 'build' as well as 'run' container images used as a base for the Teranode project, plus a 'runner' image for Teranode's self-hosted CI runners (see Runner image).
These container images exist to install build and runtime dependencies for the application.
They are sourced at the top of the main Teranode Dockerfile at Dockerfile.
Check new changes into the repo to get the CICD process to run. Please test the Dockerfiles locally before pushing changes to the repo.
There are no automated tests for these builds at this time. [Todo: Add tests]
Dockerfile_runner builds the image that Teranode's self-hosted runners use. They run on Kubernetes through GitHub's Actions Runner Controller (ARC), which starts one runner pod per job from this image. It extends the stock ghcr.io/actions/actions-runner image with tools Teranode's CI jobs expect from GitHub-hosted runners:
build-essential(gcc, g++,make, libc and libstdc++ headers) for cgo, whichgo test -raceand gobdk need, and formaketargets- the
docker composeCLI plugin (Docker Compose 2.38.2, the version GitHub-hosted Ubuntu 24.04 runners ship), checked against its SHA-256. It needs a Docker daemon, which on ARC is the Docker-in-Docker sidecar of the runner pod zstd, soactions/cachecompresses with zstd as on GitHub-hosted runners.actions/cachematches caches by compression method too, so without zstd jobs miss every cache saved with itxz-utils,wgetandbc, small tools that scripts commonly assume, for example to fetch and unpack.tar.xzreleases
Go and Node are not baked in: each job installs the version it needs with actions/setup-go and similar actions. The image still runs as the runner user (uid 1001).
It is built for amd64 only, by .github/workflows/teranode_base_runner.yaml, on pushes to main that touch Dockerfile_runner or that workflow, or by a manual run. Each build on main publishes:
ghcr.io/bsv-blockchain/teranode-base:runner-<short-sha>: use this one in the runner configurationghcr.io/bsv-blockchain/teranode-base:runner-latest- the same two with an
-amd64suffix, which the shared build workflow pushes first
<short-sha> is the abbreviated commit SHA of the build, as shown in the workflow run and in the package's tag list.
The runner image is rebuilt only when Dockerfile_runner or its workflow changes. The build and run images keep rebuilding on every push to main, except a push that touches only those two runner files.
ARC runners don't update themselves, and GitHub expects self-hosted runners to move to a new runner release within 30 days of it coming out, so bump this regularly.
- Pick the new release from actions/runner releases and update the
FROM ghcr.io/actions/actions-runner:<version>line inDockerfile_runner. - Build and check it locally:
docker build --platform linux/amd64 -f Dockerfile_runner -t teranode-runner . docker run --rm --platform linux/amd64 teranode-runner bash -c 'id; gcc --version; make --version; docker compose version; zstd --version; ls /home/runner/run.sh' - Merge to
main, then change the image tag in the runner scale set configuration (kept outside this repo) to the newrunner-<short-sha>. Rolling back is pointing it at the previous tag.
To bump Docker Compose, change COMPOSE_VERSION and COMPOSE_SHA256 together. The SHA-256 is the digest of the docker-compose-linux-x86_64 asset on the release page. Matching the version in GitHub's Ubuntu 24.04 image keeps jobs behaving the same on both kinds of runner.