Repository navigation
Rebuild images automatically when their base image changes - #2
Merged
Merged
Conversation
Builds each PHP version in its own job, uses the old BuildKit for 5.2-5.5, and pushes to Docker Hub on manual runs. build.sh gets --list so the workflow reads the versions from one place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NxBArk6ZTH6vAmDaok99S
build.sh records the base image name and digest as OCI labels. A daily workflow compares that digest with the current one and calls build.yml (now reusable) to rebuild and push only the outdated versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016NxBArk6ZTH6vAmDaok99S
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.
Requested by Karol · project thread
Summary
build.shlabels every image withorg.opencontainers.image.base.nameandorg.opencontainers.image.base.digest(digest read withdocker buildx imagetools inspect; skipped if it cannot be read).build.sh --base <ver>prints a version's base image (from the table, or from the Dockerfile'sFROM/ARG BASE_IMAGEfor legacy images and 7.4-mongodb1.18)..github/workflows/rebuild.yml: daily at 04:17 UTC (and manual). Compares each base image's current digest with the label in the pushed image and callsbuild.ymlwithpush: truefor the outdated versions only. Images without the label are rebuilt once.build.ymlis now reusable (workflow_call);PUSHfollowsinputs.pushfor both manual and called runs; concurrency group includes the event name so a push tomaindoes not cancel a scheduled rebuild.Note: the first scheduled run will rebuild and push all 13 images, because the images pushed today have no base-digest label yet.
Test plan
./build.sh --basechecked for all 13 versions;bash -n build.sh; YAML validated.imagetools inspect --format '{{json .Image}}'+ jq).Generated by Claude Code