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

Unable to specify a platform when generating an index image via opm using podman as a build tool #1035

Open
tinaselenge opened this issue Oct 25, 2022 · 1 comment

Comments

@tinaselenge
Copy link

tinaselenge commented Oct 25, 2022

There is no option to specify a platform when generating an index image via opm using podman as a build tool. This is a problem when trying to generate linux/amd64 compatible images on m1 mac. For example, I built a bundle image that is compatible with linux/amd64:

podman build -t <BUNDLE_IMAGE> --platform=linux/amd64 . 

Then generated an index image for it:

 opm index add --bundles <BUNDLE_IMAGE> --tag <INDEX_IMAGE>

When running the image in a cluster, the container crashes due to exec /bin/opm: exec format error . We think this is because the index image was built on linux/arm64 instead of linux/amd64.

When choosing docker as a build tool in the opm command, this doesn't seem to be a problem if you set the following docker env variable:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

However this env variable does not seem to take an effect for podman. You have to set --platform option in the podman command.

@coriaedu
Copy link

I found a similar issue here. I have a <BUNDLE_IMAGE> generated only for linux/amd64 platform.

Then, on an linux/arm64 machine, running the opm registry add fails because with podman because it is trying to pull an image that matches the host platform (linux/arm64) and it is not found.

opm registry add --bundle-images <BUNDLE_IMAGE> --container-tool podman

The environment is a little more complicated than the example, but that's the gist of it.

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

2 participants