Repository navigation
build: publish a FROM scratch artifact image of the gog binary - #4
Merged
Merged
Conversation
Containerfile.artifact builds gog exactly as upstream's Dockerfile does (static, trimmed, stripped, -X stamped) in a digest-pinned hi/go stage and emits a FROM scratch image whose only content is /gog. Consumers such as rh-forge/openclaw-saw-image inline it with a digest-pinned COPY --from instead of compiling gog inside their own builds. The publish workflows are the organisation's standard set (publish-image, publish-pr-image via workflow_run, cleanup-pr-image, prune-images) with two deliberate differences for an artifact that downstream pins by digest: - sha-<commit> tags are immutable. A guard step refuses to publish a commit whose sha- tag already exists, because re-pointing the tag would orphan the old digest and let prune-images delete it out from under every consumer pinned to it. - No semver/tag trigger. This fork cuts no releases, and a tag build would be exactly the kind of same-commit republish the guard forbids. Version, commit, and date are stamped from git in the workflow (commit date rather than wall clock) because .dockerignore excludes .git. Each push run writes the ready-to-paste tag@digest pin to the job summary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes this fork's build output as a minimal artifact image,
ghcr.io/rh-forge/gog, sorh-forge/openclaw-saw-imagecan inline the binary with a digest-pinnedCOPY --frominstead of compiling gog inside its own build. Consumer side: rh-forge/openclaw-saw-image#25. Sibling: rh-forge/cli-microsoft365#5.What's in it
Containerfile.artifact: digest-pinnedhi/go:1.26stage builds gog exactly as upstream'sDockerfiledoes (CGO_ENABLED=0,-trimpath, stripped,-Xstamped), withGOARCH=${TARGETARCH}so the workflow'splatforms:decides the published arch and a native arm64 trial works locally. The final stage isFROM scratchcontaining only/gog. Upstream'sDockerfile,docker.yml,ci.yml, and goreleaser config are untouched.publish-image,publish-pr-imageviaworkflow_run,cleanup-pr-image,prune-images), with two deliberate differences for an artifact that consumers pin by digest:sha-<commit>tags are immutable (a guard refuses to republish an existing one), and there is no semver/tag trigger. Version, commit, and commit date are stamped from git in the workflow, since.dockerignoreexcludes.git. Each push run writes the ready-to-pastetag@digestpin to the job summary.Verified locally
Built and run natively on arm64 and emulated on amd64; the amd64 binary is a static x86-64 ELF (43.6 MB) that runs in a
ubi9/ubi-minimalconsumer stage with the version stamp intact. CI buildslinux/amd64.Follow-ups
gh workflow disable docker.ymlso PRs stop also building upstream's alpine runtime image.gogpackage topackage-permsand grantopenclaw-saw-imageread (manual GHCR UI step).🤖 Generated with Claude Code