feat: add support for tagging architecture specific images#879
feat: add support for tagging architecture specific images#879jsing-canva wants to merge 1 commit intobazel-contrib:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| MANIFEST_DIGEST=$("${JQ}" -r '.manifests[0].digest' "${IMAGE_DIR}/index.json") | ||
| MANIFEST_FILE="${IMAGE_DIR}/blobs/${MANIFEST_DIGEST%%:*}/${MANIFEST_DIGEST##*:}" | ||
| IMAGE_DIGESTS=$(${JQ} -r '.manifests[]? | [ .digest, .platform.os, .platform.architecture ] | @tsv ' "${MANIFEST_FILE}") |
There was a problem hiding this comment.
Platform tagging reads image manifest instead of index
To build the per-platform tag list, MANIFEST_DIGEST is taken from index.json and used to open that manifest’s blob, then .manifests[] is queried from that file. For a standard OCI layout this blob is a single image manifest and contains no manifests array, so IMAGE_DIGESTS is empty and --tag-platform-images never tags any platform images. The per-platform digest list should be derived from index.json itself rather than a child manifest.
Useful? React with 👍 / 👎.
|
Add a `tag_platform_images` attribute to `oci_push`, which if enabled,
results in each platform specific image being tagged with each remote
tag and an additional '-${os}-${arch}' suffix. This makes it possible
to reference platform specific images as `${tag}-${os}-${arch}`
(e.g. "v1.2.3-linux-arm64").
This makes it easier to use rules_oci and multi-image indexes, with
systems that do not handle OCI image indexes (such as AWS Lambda)
and instead require a reference to a platform specific image.
2f4e544 to
679245a
Compare

Add a
tag_platform_imagesattribute tooci_push, which if enabled, results in each platform specific image being tagged with each remote tag and an additional '-${os}-${arch}' suffix. This makes it possible to reference platform specific images as${tag}-${os}-${arch}(e.g. "v1.2.3-linux-arm64").This makes it easier to use rules_oci and multi-image indexes, with systems that do not handle OCI image indexes (such as AWS Lambda) and instead require a reference to a platform specific image.