Authoritative reference for the Evergreen Image Registry CI/CD pipeline. This registry serves 1014+ container images across four tiers for HFT (high-frequency trading) infrastructure.
The pipeline is composed of four GitHub Actions workflow files:
| Workflow | Trigger | Purpose |
|---|---|---|
build-on-push.yml |
Push tomain, PRs to main |
Incremental build of changed images |
build-nightly.yml |
Cron0 3 * * * (03:00 UTC) |
Full rebuild of all images |
build-on-demand.yml |
workflow_dispatch |
Manual builds with configurable parameters |
_build-reusable.yml |
Called by the three above | Shared build, push, and sign logic |
The build graph is manifest-driven. Each image under images/<name>/has amanifest.toml declaring its tier, version,
and build configuration. The top-level manifest.toml defines global settings (batch size, timeouts, tier defaults,
builder configuration).
Image discovery is handled by scripts/discover-images.sh, which supports four modes:
| Mode | Argument | Description |
|---|---|---|
changed |
(none) | Images whose files changed in the last commit |
tier |
critical, standard, community, experimental |
All images in a tier |
images |
Comma-separated names | Specific images by name |
all |
(none) | Every image with a Dockerfile |
The script outputs a JSON matrix consumed by GitHub Actions:
{
"include": [
{ "batch": 0, "images": "nginx,redis,grafana", "count": 3 },
{ "batch": 1, "images": "postgres,mysql", "count": 2 }
]
}
Batch size is controlled by build.batch_sizein the top-levelmanifest.toml (default: 50). The matrix uses
fail-fast: false so one failing image does not abort the entire batch.
Each image is assigned exactly one tier. The tier determines build schedule, signing policy, multi-arch support, and push behavior.
| Tier | Count | Schedule | Sign | Multi-arch | Push | SBOM |
|---|---|---|---|---|---|---|
critical |
80 | Weekly (nightly in CI) | Yes | Yes | Always | Yes |
standard |
861 | Weekly (nightly in CI) | No | Yes | Nightly only | Yes |
community |
71 | Monthly | No | No (amd64) | Nightly only | Yes |
experimental |
Manual only | Manual | No | No | On demand | No |
Critical – Production services for internal HFT infrastructure. Zero failure tolerance. Every push touching a critical image triggers an immediate build with signing and multi-arch output. Nightly rebuild is mandatory.
Standard – Useful tools and services. Built on push when changed. Pushed during nightly builds. Failures are warned but do not block other images.
Community – Experimental or contributed images. Built on push when changed. amd64 only by default. Pushed during nightly builds with warn-not-fail.
Experimental – Unstable or work-in-progress. Manual dispatch only. No signing, no SBOM, no automatic pushes.
Tier is declared per-image in images/<name>/manifest.tomlunder the[metadata] section:
[metadata]
name = "nginx"
version = "1.27.1"
tier = "critical"
There is no central list of images per tier. The tier for each image is resolved at build time by reading its manifest.
Older manifests may use numeric tier values. The resolve_tier()function inscripts/discover-images.sh maps these to
semantic names:
"1" -> "critical"
"2" -> "standard"
"3" -> "community"
If a manifest has no tierfield, the default is"standard".
File: .github/workflows/build-on-push.yml
on:
push:
branches: [main]
paths:
- 'images/**'
- 'scripts/**'
- 'manifest.toml'
- '.github/workflows/_build-reusable.yml'
- '.github/workflows/build-on-push.yml'
pull_request:
branches: [main]
paths:
- 'images/**'
- 'scripts/**'
- 'manifest.toml'
scripts/discover-images.sh changedwithfetch-depth: 2to compare againstHEAD~1. If only
shared infrastructure (scripts/, manifest.toml, CI workflows) changed but no specific image files, falls back to
building critical tier only.continue-on-error: true. Failures are warnings, not gates._build-reusable.yml with the discovered matrix.main: builds and pushes (push is enabled).push: $).concurrency:
group: build-on-push-$
cancel-in-progress: false
Concurrent pushes to the same ref are serialized. In-progress runs are not cancelled.
File: .github/workflows/build-nightly.yml
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
tier:
description: 'Build only this tier (leave empty for all)'
type: choice
options: ['', 'critical', 'standard', 'community']
sign:
description: 'Sign images with Cosign'
type: boolean
default: true
Images are built tier-by-tier in dependency order. Each tier is a separate job so failures in lower tiers do not block higher tiers:
The reportjob runs withif: always() and produces a markdown summary table with per-tier image counts and build
results:
| Tier | Images | Build |
|-----------|--------|-----------|
| Gates | - | success |
| Critical | 80 | success |
| Standard | 861 | success |
| Community | 71 | failure |
File: .github/workflows/build-on-demand.yml
| Input | Type | Default | Description |
|---|---|---|---|
mode |
choice | (required) | tier, images, or changed |
filter |
string | (empty) | Tier name or comma-separated image names |
sign |
boolean | false |
Sign images with Cosign |
multiarch |
boolean | true |
Build for amd64+arm64 |
push |
boolean | true |
Push to registry |
tag |
string | commit SHA | Custom tag override |
The validate job checks inputs before proceeding:
tiermode: filter must becritical, standard, community, or experimental.images mode: filter must be non-empty (comma-separated image names).changed mode: no filter required.Invalid inputs produce an ::error:: annotation and fail the workflow.
images, filter=nginx, push=false.images, filter=img1,img2,img3, push=true.tier, filter=critical.images, filter=redis, tag=v7.4.8-patch1.changed on a branch.The tier label passed to the reusable workflow is demand-<mode>(e.g.,demand-tier, demand-images) for reporting
purposes.
_build-reusable.yml) Design DecisionsFile: .github/workflows/_build-reusable.yml
Build and push are separate steps. The build step saves each image as a tarball via
--output type=docker,dest=/tmp/images/<name>.tar. The push step loads the tarball with docker load -i <tarball> and
pushes the loaded image.
This pattern exists to work around BuildKit COPY evaluation failures that occur when BuildKit re-evaluates Dockerfile instructions during a push. By loading from a pre-built tarball, the push step bypasses BuildKit entirely.
Trade-off: The tarball contains a single-architecture image. Multi-arch pushes require a different strategy (buildx bake with registry cache, not yet implemented).
# Build step produces tarball
--output "type=docker,dest=/tmp/images/${SAFE}.tar"
# Push step loads tarball (no rebuild)
docker load -i "$TAR"
docker push "${REF}"
Individual image build failures emit ::warning:: annotations rather than failing the entire batch. This is critical
for nightly builds where one broken image should not prevent the other 1000+ images from being built and pushed.
if build_image "${image}"; then
BUILT=$((BUILT+1))
else
echo "::warning::${image}: build failed, retrying..."
# ... retry once ...
echo "::error::${image}: build failed after 2 attempts"
FAILED=$((FAILED+1))
fi
Build failures trigger a single automatic retry with a 5-second delay. After two failures, the image is skipped and a warning is emitted.
Push and sign steps use if: always() so they execute even when some matrix jobs fail:
- name: Push to registry
if: always() && inputs.push
run: ...
- name: Sign Images
needs: build
if: always() && inputs.push && inputs.sign
...
This ensures that successfully built images are still pushed and signed even if other images in the same batch failed.
The reusable workflow declares permissions: {} at the top level. Per-job permissions are set on individual jobs. This
is a GitHub Actions requirement for reusable workflows – the caller’s permissions are not inherited unless explicitly
passed via secrets: inherit.
permissions: {} # required: reusable workflows don't inherit caller permissions
jobs:
build:
permissions:
contents: read
packages: write
sign:
permissions:
id-token: write
packages: write
contents: read
strategy:
fail-fast: false
max-parallel: 5
matrix: $
fail-fast: false is essential – with 1014+ images, a single flaky build must not abort the entire run.
max-parallel: 5 limits concurrent batch jobs to stay within GitHub Actions runner quotas.
The builder is recreated every 5 images to prevent BuildKit resource exhaustion:
if [ $((BUILT + FAILED)) -gt 0 ] && [ $(( (BUILT + FAILED) % 5 )) -eq 0 ]; then
recreate_builder
fi
Builder configuration uses BuildKit v0.12.0 with unlimited log size:
driver-opts: |
image=moby/buildkit:v0.12.0
env.BUILDKIT_STEP_LOG_MAX_SIZE=-1
env.BUILDKIT_STEP_LOG_MAX_SPEED=10
Build tarballs and image reference lists are uploaded as artifacts with 7-day retention:
- name: Upload image tarballs
if: always()
uses: actions/upload-artifact@v4
with:
name: images-$-batch-$
path: /tmp/images/
retention-days: 7
- name: Upload built image references
if: always()
uses: actions/upload-artifact@v4
with:
name: built-list-$-batch-$
path: /tmp/built-images.txt
retention-days: 7
These artifacts are consumed by the sign job and are available for debugging failed builds.
docker buildx build \
--builder "$CURRENT_BUILDER" \
--platform linux/amd64 \
-t "${REF}" \
--output "type=docker,dest=/tmp/images/${SAFE}.tar" \
--no-cache \
--build-arg "BUILD_DATE=${TAG}" \
--build-arg "VCS_REF=${TAG}" \
--build-arg "TARGETARCH=amd64" \
--build-arg "GITHUB_TOKEN=$" \
--label "org.opencontainers.image.source=$/$" \
--label "org.opencontainers.image.revision=$" \
"./images/${image}"
Key flags:
--no-cache – Ensures fully clean builds for reproducibility. Nightly rebuilds must not be affected by stale cache
layers.--output type=docker,dest=... – Produces a tarball instead of loading into local Docker daemon.--build-arg GITHUB_TOKEN– Passed for same-repo file downloads only (e.g.,COPY from the same repository). Must
not be used for cross-repo downloads (see Section 10).--label org.opencontainers.image.source/revision – OCI standard labels for traceability.| Argument | Source | Purpose |
|---|---|---|
BUILD_DATE |
Tag value | Build timestamp for OCI labels |
VCS_REF |
Tag value | Git reference for OCI labels |
TARGETARCH |
Alwaysamd64 |
Target architecture forARG TARGETARCH in Dockerfiles |
GITHUB_TOKEN |
secrets.GITHUB_TOKEN |
Auth for same-repo downloads |
SOURCE_DATE_EPOCH is set from the current timestamp at the start of each job:
- name: Set SOURCE_DATE_EPOCH
run: echo "SOURCE_DATE_EPOCH=$(date -u +%s)" >> "$GITHUB_ENV"
This ensures consistent timestamps across layers for reproducible builds.
Multi-arch is controlled at two levels:
multiarchinput to_build-reusable.yml (set by the calling workflow based on tier).multiarchfield inimages/<name>/manifest.toml.Images that should not build multi-arch include Go source builds (QEMU emulation timeout), Rust source builds, and
images with architecture-specific dependencies. For these images, set multiarch = false in the per-image manifest.
Currently, the build step always produces linux/amd64 tarballs. Multi-arch support via buildx bake is a planned
improvement (see Section 12).
| Timeout | Value | Scope |
|---|---|---|
| Per-image build | 900 seconds (15 min) | timeoutwrapper arounddocker buildx build |
| Per-image push | 300 seconds (5 min) | timeoutwrapper arounddocker push |
| Batch job | 360 minutes (6 hours) | timeout-minutes on the job |
| Sign job | 30 minutes | timeout-minutes on the sign job |
After building, an enforcement step checks tarball sizes against limits defined in manifest.toml:
[build.size_limit]
scratch_mb = 50
distroless_mb = 50
wolfi_mb = 200
debian_slim_mb = 200
Exceeding the limit emits an ::error::annotation. The check usescontinue-on-error: true so it warns without
blocking.
The top-level manifest declares GHA cache configuration:
[build.cache]
type = "gha"
mode = "max"
compression = "zstd"
Note: The current build step uses --no-cache, so cache is not actively used during builds. This configuration is
reserved for future use when selective caching is enabled.
The push step iterates over the same image list from the matrix. For each image:
/tmp/images/<name>.tar.docker load -i "$TAR".docker tag "${REF}" "${REF}".docker push "${REF}".If a tarball is missing (build failed), the push is skipped with a warning:
if [ -f "$TAR" ]; then
docker load -i "$TAR" 2>/dev/null || true
docker push "${REF}" 2>&1
else
echo "::warning::${image}: no tarball (build failed), skipping push"
fi
Primary registry: ghcr.io/<owner>/<image-name>
Docker Hub login is attempted with continue-on-error: true:
- name: Login to Docker Hub
if: inputs.push
continue-on-error: true
uses: docker/login-action@v3
with:
registry: docker.io
username: $
password: $
Docker Hub publication is not yet fully implemented. The login is present for future use.
Each image receives a single tag per build. The tag is determined by the calling workflow:
$ (full commit SHA).$.inputs.tag, or $ if not specified.Additional tags (:version, :latest, :sha-<short>) are planned for future implementation.
Signing uses Cosign keyless signing via Fulcio OIDC:
cosign sign --yes \
--certificate-identity="$" \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
"${ref}"
The sign job downloads all built-list-* artifacts from the build job, concatenates the image reference lists, and
signs each unique reference. Sign failures emit ::warning:: and do not block the workflow.
Signing requires id-token: write permission for OIDC token generation.
manifest.toml at repo root)Defines global build settings and tier defaults:
[registry]
name = "ghcr.io/wyattau/evergreenimageregistry"
default_platforms = ["linux/amd64", "linux/arm64"]
[build]
batch_size = 50
per_image_timeout_seconds = 900
batch_timeout_minutes = 360
max_parallel_batches = 5
builder_recreate_interval = 5
builder_image = "moby/buildkit:v0.12.0"
[tier.critical]
description = "Production images for internal HFT infrastructure"
sign = true
sbom = true
multiarch = true
[tier.standard]
description = "Community and multi-company images"
sign = false
sbom = true
multiarch = true
[tier.community]
description = "Contributed images, lower priority"
sign = false
sbom = true
multiarch = false
images/<name>/manifest.toml)[metadata]
name = "nginx"
version = "1.27.1"
description = "Nginx - HTTP and reverse proxy server"
vendor = "Nginx Inc"
source = "https://github.com/nginx/nginx"
license = "BSD-2-Clause"
tier = "critical"
upstream_version = "1.27.1"
[build]
base = "scratch"
user = "65532:65532"
stopsignal = "SIGTERM"
[source]
type = "package-manager"
url = "https://github.com/nginx/nginx/releases/download/v1.27.1/nginx-1.27.1-linux-amd64.tar.gz"
[runtime]
entrypoint = ["/nginx"]
[ports]
expose = [80, 443, 9101]
[labels]
"org.opencontainers.image.title" = "nginx"
"evergreen.image.tier" = "critical"
"evergreen.hft.deploy-strategy" = "hft-rolling"
| Field | Section | Required | Description |
|---|---|---|---|
name |
[metadata] |
Yes | Image name (must match directory name) |
version |
[metadata] |
Yes | Semantic version |
tier |
[metadata] |
No | critical, standard, community, or experimental. Defaults to standard |
description |
[metadata] |
No | Human-readable description |
vendor |
[metadata] |
No | Upstream vendor name |
source |
[metadata] |
No | Upstream source URL |
license |
[metadata] |
No | SPDX license identifier |
upstream_version |
[metadata] |
No | Exact upstream version for version tracking |
base |
[build] |
No | Base image reference |
user |
[build] |
No | UID:GID for the runtime user |
stopsignal |
[build] |
No | Container stop signal |
entrypoint |
[runtime] |
No | Container entrypoint |
cmd |
[runtime] |
No | Container default command |
expose |
[ports] |
No | List of exposed ports |
multiarch |
[build] |
No | Override multi-arch for this image |
Set multiarch = falsein the[build] section of a per-image manifest to disable multi-arch builds for that specific
image. Use this for:
Error: failed to calculate checksum of ref::<sha>:: failed to walk ...
Cause: BuildKit re-evaluates COPY instructions during push, which can fail when the build context has changed or
when using multi-stage builds with complex COPY patterns.
Remedy: The tarball-load push pattern in _build-reusable.yml already handles this. The build step saves a tarball,
and the push step loads it with docker load instead of rebuilding.
Reference: dockerfile-standards.md Section 2.
Error: 404 Not Foundwhen a Dockerfile usesCOPYorADD to download from a different repository.
Cause: GITHUB_TOKEN only has access to the current repository. Cross-repo downloads fail with 404.
Remedy: Remove authentication headers for cross-repo URLs. Use public URLs without passing GITHUB_TOKEN as a build
argument for those specific downloads.
Reference: dockerfile-standards.md Section 5.
Error: /bin/sh: curl: not found in Dockerfiles based on wolfi/Chainguard.
Cause: wolfi minimal images do not include curl by default.
Remedy: Use wgetinstead ofcurl in Dockerfiles.
Reference: dockerfile-standards.md Section 4.
Error: Push step fails because BuildKit attempts to rebuild the image.
Remedy: Already handled by the tarball-load pattern. The push step calls docker load -i <tarball> and never
invokes BuildKit.
Error: Batch job exceeds 6-hour timeout.
Cause: Too many slow-building images in a single batch.
Remedy: Reduce build.batch_sizeinmanifest.toml. Check per-image build times in the Actions log. Images
exceeding 15 minutes should be investigated for optimization (smaller base, fewer layers, pre-built binaries).
GitHub API: 5,000 requests/hour per token. GitHub Packages: 100 GB bandwidth per month on free tier.
Symptoms: docker push returns 429, or API calls in scripts fail with 403.
Remedies:
Symptoms: Builds hang or fail with no space left on device or OOM.
Remedy: The builder is automatically recreated every 5 images (builder_recreate_interval = 5). If exhaustion
occurs more frequently, reduce this value in manifest.toml.
All build runs are visible at: <https://github.com/WyattAu/EvergreenImageRegistry/actions>
::error:: – Hard failures that fail the step (e.g., validation errors, image size violations).::warning:: – Soft failures that do not block the workflow (e.g., build failures for individual images in nightly
builds).::notice:: – Informational messages (e.g., “no images changed”, builder recreation).Annotations are visible in the Actions log for each workflow run and in PR checks.
The nightly workflow generates a markdown summary table posted to the Actions run summary page. It includes:
Critical tier has zero failure tolerance. If build-critical fails in the nightly build:
failure for the critical row.::error:: annotations.scripts/build_monitor.py provides programmatic access to build results for custom alerting integrations.
Replace the tarball-load pattern with docker buildx bake for multi-arch pushes. This would eliminate the single-arch
limitation of tarballs and enable native multi-platform manifest creation.
The Docker Hub login is already present in _build-reusable.yml. Full mirror publication requires adding Docker Hub
tagging and push logic alongside the ghcr.io push.
SBOM generation scripts already exist (scripts/generate_sbom.sh, scripts/generate_all_sboms.sh). Integration into
the CI pipeline as a post-build step would produce SBOMs for every image and attach them as workflow artifacts.
Block push of images with critical or high CVEs. This would use Trivy or Grype (both already available as images in the registry) as a scanning step between build and push.
scripts/pin_digests.sh exists for pinning image digests. Integration into the CI pipeline would automatically update
FROM lines to pinned digests after successful builds.
Automated promotion path: community->standard->critical. This would require:
tier field in per-image manifests.