Build the base and CI images from a workflow instead of by hand #148
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#148
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
docker/build/Dockerfile.baseis published asforge.lvl0.xyz/lvl0/fedi-feed-router-base:latestand consumed by theproduction build (
Dockerfile:2). Nothing in the repository builds it:Dockerfile.baseorfedi-feed-router-basebuild.ymlbuilds only the application image, and assumes the base alreadyexists
So the base image is built and pushed by hand. Editing
Dockerfile.basechangesnothing until someone remembers to rebuild, and there is no record of what is
currently in the published
:latest.#147 makes this worse by adding a second image (
fedi-feed-router-ci) with thesame property, which CI then depends on to run at all.
Proposed
A workflow that builds and pushes both images, triggered on changes under
docker/build/**and manually viaworkflow_dispatch, following the registrylogin and tagging approach already used in
build.yml.Both images get
:latestand a commit-sha tag, so a specific build can beidentified and rolled back to.
Open question: tagging strategy
Consumers currently pin
:latest, which means a change to a base imagesilently alters every consumer's environment on their next run. That is the
behaviour that makes a hand-built image risky in the first place.
Options:
:latestfor simplicity, and accept that base changes take effectimmediately and invisibly.
consuming file. Safer and more traceable, but every base change then needs a
follow-up commit in
Dockerfileandci.yml.Worth deciding deliberately rather than inheriting
:latestby default.Acceptance criteria
fedi-feed-router-baseandfedi-feed-router-cidocker/build/**and can be dispatched manually:latestand with the commit sha.claude/PLATFORM.md, since itis currently undocumented anywhere
Related
Dockerfile.ciand makes CI depend on the published imageThe
:latestproblem is not theoreticalHit during #147. Recording it here because it answers this ticket's open
tagging question with evidence rather than preference.
The CI image was rebuilt to add
gdand pushed tofedi-feed-router-ci:latest. Verified afterwards that the image was correct:docker run ... php -m | grep -i gdon the local image returnedgddocker manifest inspecton the registry copy returned config digestsha256:ab8ecd4f..., matching the local image id exactlySo the registry held the right image. The runner kept using an older one
anyway: two consecutive CI runs failed with
ext-gd ... missing from your system, and the loaded-extension list in the error output showed onlyopcache, pcntl and sodium. Re-running the job did not help.
The runner caches mutable tags and does not re-pull them.
Resolution taken in #147: consumers pin an explicit version tag. The CI
image is now published as
fedi-feed-router-ci:php8.3-1andci.ymlpins thattag;
:latestand the commit sha are still published alongside it. Therevision suffix is bumped whenever the image contents change.
Still open for this ticket:
Dockerfile:2pinsfedi-feed-router-base:latestfor the production build. That was deliberatelyleft alone in #147 to keep the production build path out of a CI change, but it
has exactly the same exposure — a base image rebuild silently changes what
production is built from, with no way to roll back to a known-good base. Worth
deciding whether production pins a version tag too.