Skip to content

Publish the pinned environment to GHCR - #37

Merged
rjnienaber merged 1 commit into
mainfrom
feat/publish-image
Sep 7, 2026
Merged

rjnienaber merged 1 commit into
mainfrom
feat/publish-image

Conversation

@rjnienaber

@rjnienaber rjnienaber commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Everything in the Dockerfile is pinned, but a rebuild still produces its own layers: apt indexes move, timestamps differ, and CI's image and a developer's image agree on every version without being the same image. Enough for the toolchains to match; not enough to name in a bug report, which is what a digest is for.

What changed

  • .github/workflows/ci.yaml — the container job gains packages: write and a publish step guarded by github.event_name == 'push' && github.ref == 'refs/heads/main', placed after make docker_test. An image nobody has run is not one to hand to anybody, and a pull request's image is a proposal rather than the environment.
  • docker/publish.sh — logs in with GHCR_TOKEN when given, pushes :latest and :git-<short sha>, reads the digest back from the registry and writes it to the job summary. latest answers "what is current" and nothing else; a run that has to be reproduced needs a name that still means the same image next month.
  • make pull_image — takes a digest as readily as a tag (PUBLISHED_REF=...@sha256:...) and gives either the local name the rest of the tooling already uses, so docker/run.sh reports the registry digest in $PRESCRIPT_IMAGE without knowing where the image came from.
  • make push_image — the same thing by hand.
  • Docs: docs/container.md gains a "Where it lives" section (the old "not published anywhere yet" note is gone); README's development section mentions the pull.

Cost

Public packages on GitHub Packages carry no storage or bandwidth charge, and this repository is public. If the first publish ever creates the package private, that is one setting on the package rather than a change here — worth checking after the first run on main, since the image is around a gigabyte.

Verification

make docker_test passes; the dice histogram is unchanged. The workflow YAML parses, docker/publish.sh passes bash -n, its missing-image guard was exercised, and the tag path was checked against a scratch name. The push itself cannot be run from here — the local gh token has no write:packages scope — so it is first exercised by CI on merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_019f9gkZVUEo3jtv51GSb4vJ

Everything in the Dockerfile is pinned, but a rebuild still produces its own
layers: apt indexes move, timestamps differ, and CI's image and a developer's
image agree on every version without being the same image. That is enough to
make the toolchains match and not enough to name in a bug report, which is
what a digest is for.

CI pushes to ghcr.io/rjnienaber/prescript-env from main, and only after the
suite has passed inside the image it is about to publish: an image nobody has
run is not one to hand to anybody, and a pull request's image is a proposal
rather than the environment. Two tags go up, because latest answers "what is
current" and nothing else, while a run that has to be reproduced needs a name
that still means the same image next month.

`make pull_image` takes a digest as readily as a tag and gives either the
local name the rest of the tooling already uses, so docker/run.sh reports the
registry digest in $PRESCRIPT_IMAGE without knowing where the image came
from -- which is the half of a repro block the environment file cannot
supply.

Public packages on GitHub Packages carry no storage or bandwidth charge, and
this repository is public, so the image costs nothing to host.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019f9gkZVUEo3jtv51GSb4vJ
@rjnienaber
rjnienaber merged commit ad07fe7 into main Sep 7, 2026
5 checks passed
@rjnienaber
rjnienaber deleted the feat/publish-image branch September 7, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant