-
Notifications
You must be signed in to change notification settings - Fork 76
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
Makefile add optional CONTAINER_PLATFORM flag to container builds #7347
Conversation
Signed-off-by: Guy Margalit <guymguym@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -3,6 +3,14 @@ ifeq ($(CONTAINER_ENGINE),) | |||
CONTAINER_ENGINE=$(shell podman version >/dev/null 2>&1 && echo podman) | |||
endif | |||
|
|||
# see https://github.com/containerd/nerdctl/blob/main/docs/multi-platform.md | |||
# e.g use CONTAINER_PLATFORM=amd64 for building x86_64 on arm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# e.g use CONTAINER_PLATFORM=amd64 for building x86_64 on arm. | |
# e.g use CONTAINER_PLATFORM_FLAG=amd64 for building x86_64 on arm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, notice that I had to change it because it failed otherwise. The user needs to set the CONTAINER_PLATFORM=amd64 and then the Makefile will sets the CONTAINER_PLATFORM_FLAG=--platform=amd64 (approppriately) for all the container build calls...
@guymguym, docker supports multi platform builds as well.
|
@Utkarsh-pro even better then! I just tried with lima and nerdctl, but I assumed this flag could be applicable for other container engines as well. |
@guymguym @Utkarsh-pro |
@liranmauda it was very simple for me to check that podman has the exact same --platform flag too. However I am not trying to make any suggestions about running this downstream. But if you want to try, now you can with a simple arg. |
I remember that at some point we could not do it as podman was behind. |
Explain the changes
CONTAINER_PLATFORM=amd64
for building x86_64 images on Mac arm64.CC @Utkarsh-pro
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: