Fix incorrect mediaType in arm64 executor image layers #6416
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.
The
container_push
rule fromrules_docker
seems to have a bug where it builds some (but not all) image layers with mediaTypeapplication/vnd.oci.image.layer.v1.tar
rather thanapplication/vnd.docker.image.rootfs.diff.tar.gzip
, even though we're settingformat = "Docker"
. (This only seems to happen on arm64 for some reason, but it could possibly just be because the linux arm64 runners are on ubuntu 22.04 and might have a newer version of dockerd). containerd and podman do not seem to support theoci
format, or at least they don't support mixing both types of image layers in the same manifest.I didn't see a straightforward way to customize the mediaType in any of the
rules_docker
rules, so the fix in this PR is to build the image via thecontainer_image
target but then push the image withdocker tag && docker push
instead of running thecontainer_push
target. Tested this by running the workflow manually and confirming that the arm64 image no longer has OCI-format layers.Related issues: Fixes https://github.com/buildbuddy-io/buildbuddy-internal/issues/3316