Skip to content

Commit 035e710

Browse files
authored
feat(base-images): immutable per-publish image tags (#4607)
Every publish now also pushes an immutable per-publish tag alongside the mutable one, named after the snapshot date and commit (e.g. `22-bookworm-20260812-45444a7`), so previously published digests stay tag-referenced after republishes. Shipped CLI releases pin those digests, so they must remain resolvable indefinitely. Merging triggers a republish; the fresh tag-protected digests will then be pinned by #4602 before it merges.
1 parent eefe0a3 commit 035e710

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/base-images.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
build_packages: ${{ steps.config.outputs.build_packages }}
4040
suite: ${{ steps.config.outputs.suite }}
4141
snapshot: ${{ steps.config.outputs.snapshot }}
42+
publish_id: ${{ steps.config.outputs.publish_id }}
4243
source_date_epoch: ${{ steps.config.outputs.source_date_epoch }}
4344
push: ${{ steps.config.outputs.push }}
4445
steps:
@@ -52,6 +53,7 @@ jobs:
5253
SNAPSHOT_INPUT: ${{ inputs.debian_snapshot }}
5354
EVENT_NAME: ${{ github.event_name }}
5455
REF: ${{ github.ref }}
56+
SHA: ${{ github.sha }}
5557
run: |
5658
PACKAGES="$(jq -er '.packages' base-images/images.json)"
5759
BUILD_PACKAGES="$(jq -er '.buildPackages' base-images/images.json)"
@@ -89,6 +91,7 @@ jobs:
8991
echo "build_packages=$BUILD_PACKAGES"
9092
echo "suite=$SUITE"
9193
echo "snapshot=$SNAPSHOT"
94+
echo "publish_id=${SNAPSHOT:0:8}-${SNAPSHOT:9:6}-${SHA:0:7}"
9295
echo "source_date_epoch=$EPOCH"
9396
echo "push=$PUSH"
9497
} >> "$GITHUB_OUTPUT"
@@ -164,7 +167,11 @@ jobs:
164167
platforms: linux/amd64,linux/arm64
165168
provenance: false
166169
outputs: type=image,push=true,rewrite-timestamp=true
167-
tags: triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}
170+
# The dated tag is immutable and keeps every published digest
171+
# tag-referenced forever; shipped CLI releases pin these digests
172+
tags: |
173+
triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}
174+
triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}-${{ needs.setup.outputs.publish_id }}
168175
build-args: |
169176
BASE_IMAGE=${{ matrix.image.base }}
170177
DEBIAN_SNAPSHOT=${{ needs.setup.outputs.snapshot }}
@@ -187,7 +194,9 @@ jobs:
187194
platforms: linux/amd64,linux/arm64
188195
provenance: false
189196
outputs: type=image,push=true,rewrite-timestamp=true
190-
tags: triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}-build
197+
tags: |
198+
triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}-build
199+
triggerdotdev/${{ matrix.image.repo }}:${{ matrix.image.tag }}-build-${{ needs.setup.outputs.publish_id }}
191200
build-args: |
192201
BASE_IMAGE=${{ matrix.image.base }}
193202
DEBIAN_SNAPSHOT=${{ needs.setup.outputs.snapshot }}

base-images/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ images derived from these behave like their upstream bases.
1414
## Tags and pinning
1515

1616
Tags are mutable and rebuilt in place on demand; each rebuild picks up Debian
17-
security updates published up to its snapshot date. The
17+
security updates published up to its snapshot date. Every publish also pushes
18+
an immutable per-publish tag (snapshot timestamp plus commit, e.g. `22-bookworm-20260812-000000-45444a7`) so previously
19+
published digests stay tag-referenced; never delete these, since shipped CLI
20+
releases pin their digests. The
1821
runtime itself (the node or bun binaries from the upstream base) only moves
1922
when the base digests in `images.json` are bumped. When bumping a base
2023
digest, keep the snapshot at least as new as the upstream image's own archive

0 commit comments

Comments
 (0)