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

Add platform parameter to support testing multi-platform images #373

Closed
michalszelagsonos opened this issue Sep 7, 2023 · 1 comment
Closed

Comments

@michalszelagsonos
Copy link

michalszelagsonos commented Sep 7, 2023

Docker supports building an image for multiple platforms, amd64 and arm64 for example, and it even supports running containers using platform emulators, if they are installed. I have a project where I am building an image for both amd64 and arm64. I build both platforms on amd64 compute and publish a single image using multi-platform manifest. This is supported with buildx. Since there are some significant differences how the image is built for each platform, I would like to be able to test each platform to make sure they both function the same way. The only way I think I can do that right now is to run the tests for each platform on their respective architecture, which is not very practical. For example, if I want to test amd64, I need to run tests on amd64 compute. If I want to verify arm64, I need to run on arm64. If I could specify the platform to be used for container execution, that would solve this issue. Assumption is that I need to have a functioning docker environment that allows me to run an emulated environment. So, for example, if I can do this in my amd64 environment:

docker run --platform linux/arm64 foo

Then it would be awesome to be able to do this:

container-structure-test test --platform linux/arm64 --image foo

The CLI option is very appealing since I would be able to reuse the same test config for all of the platforms I am building for.

@Sineaggi
Copy link

From what I can tell, the platform flag is not exposed to the bazel rule. Fixed in #469

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

No branches or pull requests

3 participants