Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect mediaType in arm64 executor image layers #6416

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

bduffany
Copy link
Member

@bduffany bduffany commented Apr 19, 2024

The container_push rule from rules_docker seems to have a bug where it builds some (but not all) image layers with mediaType application/vnd.oci.image.layer.v1.tar rather than application/vnd.docker.image.rootfs.diff.tar.gzip, even though we're setting format = "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 the oci 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 the container_image target but then push the image with docker tag && docker push instead of running the container_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

@bduffany bduffany changed the title Fix incorrect mediaType in arm64 image layers Fix incorrect mediaType in arm64 executor image layers Apr 19, 2024
Copy link
Contributor

@iain-macdonald iain-macdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! Do you think it'd make sense to try using the rules_oci version of container_push to see if it has the bug as well?

@bduffany
Copy link
Member Author

Good find! Do you think it'd make sense to try using the rules_oci version of container_push to see if it has the bug as well?

If we're going to try rules_oci I think we would want to migrate all of our image rules to rules_oci so we aren't in a messy state of using both rulesets at the same time. It might make sense if the benefits are worth it, but I don't know of any other benefits atm (besides fixing this one bug which we have a reasonable workaround for)

@bduffany bduffany merged commit 1813941 into master Apr 22, 2024
19 of 20 checks passed
@bduffany bduffany deleted the mediatype-fix branch April 22, 2024 14:35
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.

None yet

2 participants