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

set docker env variable to force it build images for linux/amd64 platform #223

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

showuon
Copy link
Contributor

@showuon showuon commented Sep 20, 2022

Since all our images are running in linux/amd64 platform, we need to force docker to build linux/amd64 compatible images. Without this patch, the M1 mac will fail to deploy the fleetshard operator due to the error:

State:         Waiting
      Reason:      CrashLoopBackOff
    Last State:    Terminated
      Reason:      Error
      Message:     exec /bin/opm: exec format error

Note: It won't impact any non-arm64 chip users because they will build with linux/amd64 originally.

ref: https://docs.docker.com/engine/reference/commandline/cli/#environment-variables

@showuon showuon requested a review from MikeEdgar September 20, 2022 07:49
Copy link
Contributor

@MikeEdgar MikeEdgar left a comment

Choose a reason for hiding this comment

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

LGTM. Do you know if podman considers this env also?

@showuon
Copy link
Contributor Author

showuon commented Sep 20, 2022

LGTM. Do you know if podman considers this env also?

Had a quick search, but didn't find any. Podman only provides the --platform for each command. That works for most cases, but for this opm command, we can't set any docker/podman options into it, which will also fail:

opm index add --bundles "${BUNDLE_IMAGE}" --tag "${INDEX_IMAGE}" -u docker

ref: https://docs.podman.io/en/latest/markdown/podman-build.1.html#platform-os-arch-variant

@MikeEdgar
Copy link
Contributor

Had a quick search, but didn't find any.

Same, the best I could find was a Reddit comment that seems to imply it would work (given the context of the post): https://www.reddit.com/r/docker/comments/r0r86r/comment/hlwub5r/?utm_source=share&utm_medium=web2x&context=3

I think we can go ahead and merge this. @k-wall are you using podman on an M1?

@showuon
Copy link
Contributor Author

showuon commented Sep 21, 2022

Had a quick search, but didn't find any.

Same, the best I could find was a Reddit comment that seems to imply it would work (given the context of the post): https://www.reddit.com/r/docker/comments/r0r86r/comment/hlwub5r/?utm_source=share&utm_medium=web2x&context=3

I think we can go ahead and merge this. @k-wall are you using podman on an M1?

I don't think currently podman supports running in M1 mac:
containers/podman#14303

I ran into the same error in the issue, and then decided to use docker instead.

@MikeEdgar MikeEdgar merged commit fc80ea5 into bf2fc6cc711aee1a0c2a:main Sep 21, 2022
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.

2 participants