Skip to content

fix(devcontainer): publish only multi-arch tags, push per-arch by digest#384

Merged
DevSecNinja merged 5 commits into
mainfrom
copilot/fix-devcontainer-align-tagging
Jun 2, 2026
Merged

fix(devcontainer): publish only multi-arch tags, push per-arch by digest#384
DevSecNinja merged 5 commits into
mainfrom
copilot/fix-devcontainer-align-tagging

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The dotfiles-devcontainer package exposed rolling :amd64 / :arm64 tags that drifted out of sync with the platform digests inside :latest (the :amd64 tag pointed at a newer digest than :latest's amd64 entry). Each native-runner build pushed its own per-arch tag independently, and the merge job composed :latest by resolving those mutable tags.

Workflow (.github/workflows/devcontainer-prebuild.yaml)

  • Build each arch with the Dev Container CLI and push by digest only — no :amd64 / :arm64 tags; per-arch images are stored untagged.
  • Export each pushed digest as an artifact; the merge job composes :latest and :vX.Y.Z from the exact digests built in the same run via docker buildx imagetools create, so the multi-arch tags always reference matching platform images.
  • Replaces the devcontainers/ci action with a direct devcontainer build call (the action always tags, which is what created the stray tags).
  • Caching preserved without extra tags: registry cache from :latest (same pattern as ci.yaml) plus the CLI's inline cache. PR runs build for validation only.
# per-arch (native runner): untagged, push-by-digest
devcontainer build --platform "$PLATFORM" --image-name "$IMAGE" \
  --cache-from "type=registry,ref=$IMAGE:latest" \
  --output "type=image,name=$IMAGE,push-by-digest=true,name-canonical=true,push=true"

# merge: compose multi-arch tag from this run's digests
docker buildx imagetools create --tag "$IMAGE:latest" \
  "$IMAGE@$AMD64_DIGEST" "$IMAGE@$ARM64_DIGEST"

Tests (tests/bash/validate-devcontainer.bats)

  • Updated the release-tag assertion to the imagetools create command.
  • Added a test asserting per-arch push-by-digest, manifest composition, and absence of imageTag: ${{ matrix.arch }} rolling tags.

Notes

  • Per-arch digests are parsed from buildkit's exporting manifest list output: the Dev Container CLI doesn't forward buildx's --metadata-file, so this is the available capture path.
  • Existing :latest@sha256:… pin in devcontainer.json still resolves — :latest remains a multi-arch manifest list.

Copilot AI linked an issue Jun 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix devcontainer tagging to align with latest digest fix(devcontainer): publish only multi-arch tags, push per-arch by digest Jun 2, 2026
Copilot AI requested a review from DevSecNinja June 2, 2026 09:19
@DevSecNinja DevSecNinja marked this pull request as ready for review June 2, 2026 13:56
@DevSecNinja

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

…ner-align-tagging

# Conflicts:
#	.github/workflows/devcontainer-prebuild.yaml

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merged origin/main and resolved the conflict in .github/workflows/devcontainer-prebuild.yaml. The conflict was in the merge job where main added a Checkout repository step (needed by script/devcontainer-image-size.sh) and this branch added a Set up Docker Buildx step (needed by imagetools create); I kept both. validate-devcontainer.bats passes (10/10). Merge commit: c9859ed.

@DevSecNinja DevSecNinja enabled auto-merge (squash) June 2, 2026 14:19
@DevSecNinja DevSecNinja merged commit f30f76e into main Jun 2, 2026
16 checks passed
@DevSecNinja DevSecNinja deleted the copilot/fix-devcontainer-align-tagging branch June 2, 2026 14:26
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.

fix(devcontainer): align tagging

2 participants