Skip to content

Rebuild images automatically when their base image changes - #2

Merged
narel merged 3 commits into
mainfrom
claude/project-thread-06mqxn
Nov 5, 2026
Merged

narel merged 3 commits into
mainfrom
claude/project-thread-06mqxn

Conversation

@narel

@narel narel commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Requested by Karol · project thread

Summary

  • build.sh labels every image with org.opencontainers.image.base.name and org.opencontainers.image.base.digest (digest read with docker 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's FROM / ARG BASE_IMAGE for legacy images and 7.4-mongodb1.18).
  • New .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 calls build.yml with push: true for the outdated versions only. Images without the label are rebuilt once.
  • build.yml is now reusable (workflow_call); PUSH follows inputs.push for both manual and called runs; concurrency group includes the event name so a push to main does not cancel a scheduled rebuild.
  • README: "Automatic rebuilds" section.

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 --base checked for all 13 versions; bash -n build.sh; YAML validated.
  • Label read checked against a local registry (imagetools inspect --format '{{json .Image}}' + jq).
  • This PR's CI builds all versions with the new labels.

Generated by Claude Code

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
@narel narel self-assigned this Oct 27, 2026
@narel
narel merged commit faa980b into main Nov 5, 2026
14 checks passed
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.

2 participants