We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use https://github.com/bazel-contrib/rules_oci/tree/main/examples/multi_arch code to build go project.
Then I add container_structure_test to test is that binary is runnable.
container_structure_test
multi_arch( name = "images", image = ":image", platforms = [ "//:linux_arm64", "//:linux_amd64", ], ) oci_image_index( name = "index", images = [ ":images", ], ) oci_tarball( name = "tarball", image = ":image", repo_tags = ["%s:latest" % KCP_MODULE], ) container_structure_test( name = "container_test", configs = ["container_test.yaml"], image = ":image", ) oci_push( name = "push_index", image = ":index", remote_tags = ["test"], repository = image_repository(KCP_MODULE), visibility = ["//visibility:public"], )
If I run test on Mac M1 I have exec format error.
exec format error
The problem is that container_structure_test use linux arm64 binary on darwin arm64.
Binary @ image
% docker run -it --entrypoint /bin/sh registry.my.com/image:test /opt/backup-controller $ file backup-controller backup-controller: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=redacted, stripped
Binary @ oci_tarball output
% docker run -it --entrypoint /bin/sh backup-controller:latest ~/backup-controller $ file backup-controller backup-controller: Mach-O 64-bit arm64 executable, flags:<|DYLDLINK|PIE>
How to use container_structure_test with oci_image in the right way?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use https://github.com/bazel-contrib/rules_oci/tree/main/examples/multi_arch code to build go project.
Then I add
container_structure_test
to test is that binary is runnable.If I run test on Mac M1 I have
exec format error
.The problem is that container_structure_test use linux arm64 binary on darwin arm64.
Binary @ image
Binary @ oci_tarball output
How to use container_structure_test with oci_image in the right way?
The text was updated successfully, but these errors were encountered: