-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Using the "--platform" "--arch" options when running podman run (or build) causes the values you set to become the defaults when not specified next time you build/run #15300
Comments
For a quick/rough workaround for me, I added the following into my ~/.bash_profile file
|
@flouthoc PTAL |
I think this is more about libimage then it is about buildah. I think Podman is just grabbing the local image and if it is a different Arch using it. |
I am on a train so I cannot check but please try with a more recent
version. There were a number of changes for resolving images locally.
…On Sat 13 Aug 2022 at 12:49, Daniel J Walsh ***@***.***> wrote:
I think this is more about libimage then it is about buildah.
@vrothberg <https://github.com/vrothberg> PTAL
I think Podman is just grabbing the local image and if it is a different
Arch using it.
—
Reply to this email directly, view it on GitHub
<#15300 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZDRAYN556YQ54PVQMYRQDVY54TFANCNFSM56M2GSVQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I can upgrade my podman from Wednesday and retest - will update once I've done it. |
Hi I've upgraded and confirmed the issue persists
|
I think a nice solution to this is pre-populate defaults for |
@containers/podman-maintainers WDYT ? If everyone agrees we can have a fix at buildah end for this. |
Back from PTO: Let's take a step back. I am sure there is some historical background for this behavior. Multiarch is painful and it usually boils down to exchanging one problem for another. I'll take a look at the history and report back. |
@vrothberg Ackd. |
The actual output with Podman v4.2 looks as follows:
There's more background in #12682. In short, we need to keep the current behavior to remain compatible with Docker and not break existing users. I suggest to close the issue. |
Hi @vrothberg Thanks for getting back to me and I apologise for raising a duplicate issue, I promise I did have search and couldn't find the one you linked to. There's a couple of things I want to mention:
Missing image platform warningI've tested on three different macs, all running podman --version 4.2.0 and none produced the warning you have shown above. If it matters, two were apple silicon macs, but one was an older intel based mac. I'm happy to jump on call with you and evidence this if needed. I've tried with and without the "-q" option but can't see the warning being generated. Here is the full output:
Differences in the behaviour from DockerPodman build + print the image arch:
Here is the output:
Which is same as discussed previously. Running the same command using docker has a different result, the image first pulled will become the default: Please note docker commands I had to run this on amd64 machine, so I've reordered the command slightly Command
Output is always "amd64"
This command is mostly same as the above but I have added a "image prune" to remove the image after each build to ensure the argument is used:
Now the output is what I would have expected, defaulting to the operating system version when not specified:
Note that I ran the above on a amd64 based machine with the following version of docker installed:
So more of any FYI really, but the behaviour does match what is happening with docker either. Docker's behaviour here actually seems a worse user experience to me personally. Podman DocsI appreciate you don't want to make a breaking change and have added the warning as a solution but it would be nice if the documentation could be updated to reflect this behaviour. i.e:
At the very least you can point issue reporters back the documentation in the future. |
That is a good point. These warnings won't show up on a remote client at the moment. I will look into what we can do to improve the user experience. Thanks a lot for pointing that out! |
Actually they do show up on the remote client starting with Podman v4.2.0. Note that the warnings are emitted by the server. Hence, you also need to run Podman v4.2.0 in the I will now look into what we can do with the docs. |
After pulling/creating an image of a foreign platform, Podman will happily use it when looking it up in the local storage and will not pull down the image matching the host platform. As discussed in containers#12682, the reasoning for it is Docker compatibility and the fact that user already rely on the behavior. While Podman is now emitting a warning when an image is in use not matching the local platform, the documentation was lacking that information. Fixes: containers#15300 Signed-off-by: Valentin Rothberg <[email protected]>
I'm running into this issue. I have a
I can I have another
I can If I don't have the I understand this behavior is for compatibility with It would be nice to be able to opt-in to this behavior with an option in |
SGTM |
I am not a fan (anymore) of changing that behavior. It took a long time to get it done right, so I prefer to keep things as they are. Adding an option to containers.conf adds testing and maintenance burden. It gets hairy in the details: should it only apply when looking up images in the local storage or also when pulling images? |
I find the implicit state that comes from the local images is unexpected.
My expectation is that this option makes any command that takes an |
Isn't that the current behavior? I understood your proposal that a |
The current behavior is: when no arch is specified, and an image with arch xyz is present, arch is assumed to be xyz rather than the host arch. |
That is correct, Podman will throw a warning in that case (as Docker) but proceed. |
If both mages are availabel XYZ and the host ARCH, does Podman do the correct thing and default to host ARCH? Or is it random based on the "last" created image? |
In case of a local manifest list, Podman will lookup the local platform unless otherwise specified by the user on the CLI. |
Just want to point out the docker behaviour is not the same, it's worse. when arch is specified
Output from above is always "amd64"
|
I've also been bitten several times by this. The last time I reported it was at #12682 (comment). Apologies for my insistence, but I couldn't help but +1 this :) The new warning helps and many thanks for that! But I still find the current behavior as extremely disorienting. A tangential and related issue is that the CLI output doesn't help and is in fact contributing to my confusion in addition to everything that is described above. For example, as I mentioned on the comment that I linked above, the "image list" output:
afbb9e728ec0 is the arm64 debian:bullseye image. d8cacd17cfdc ( Aiming for Docker compatibility is understandable and has been generally helpful for me! but I think this is a case of a feature that wasn't properly thought through on the Docker side, and necessitates deviating from it, even if behind a feature flag as proposed above. In my ideal world, there would be a "multiarch" config flag that would a) an "ARCH" column to that output above, and would result in both containers being listed as debian:bullseye above, but with a different arch, b) same for things like |
Let's discuss this at the next standup or container cabal, since I think @paravoid has valid ideas. @vrothberg @mtrmac WDYT? |
I've shared my opinion above a number of times. Changing the current default behavior is not an option to me. Docker compatibility is the goal and it took quite some work to get there in this context. I feel that we are all talking about slightly different things. Maybe because we're discussing multiple issues in an already closed one. But I think we can agree that we cannot satisfy all use cases with one default. If users desire a "resolve the image by name only and ignore its platform", I am OK to add that to containers.conf. For that, please open a new issue so we can tackle things separately. |
/kind bug
My understanding from the reference is the when --platform or --arch arguments is that when not specified commands such as podman build/podman run should default to the architecture of the build host, however my experience is that when not specified, the last value used will become the default.
Note: I have not tested the --os and --variant options to see if they have the same problem.
Here is the documentation I read before making raising an issue: https://docs.podman.io/en/latest/markdown/podman-build.1.html
Excerpts:
And on this page: https://docs.podman.io/en/latest/markdown/podman-run.1.html
Excerpts:
Steps to reproduce the issue:
I have experienced this problem with both podman build & podman run, I have also tested on two seperate m1 macs with the same behaviour.
Here is a command to repeat the behaviour:
Describe the results you received:
My output:
Describe the results you expected:
That the architecture is set back to the my host, which in my case should be aarch64.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
No & Yes
I am unable to upgrade my podman instance at the moment, not do I have anything spare to hand for more testing.
However I did confirm the release notes for 4.1 make no mention of this: https://github.com/containers/podman/releases/tag/v4.1.0
Additional environment details (AWS, VirtualBox, physical, etc.):
Using an m1 mac
The text was updated successfully, but these errors were encountered: