podman run --platform linux/amd64
breaks caching
#14197
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
To give some context, we provide a container of thrift compiler to our developers as that's the easiest way to distribute it:
And we also provide a shell script,
thrift-docker.sh
, to use with the container we provided as a drop-in replacement of thrift command line, so instead ofthrift --gen go file.thrift
they just runthrift-docker.sh --gen go file.thrift
instead.Because a lot of our devs are using Mac, the script supports both docker and podman. the last line of the script is something like this:
The
${docker_run_cmd}
part would be by defaultdocker run
but can be overridden topodman run --userns=keep-id
to use podman instead of docker.Now since more and more of our devs are using M1 mac, it seems that in order to use a linux/amd64 docker image on m1 mac docker you have to add
--platform linux/amd64
arg todocker run
. so the final command being executed should be something like this:exec docker run --platform linux/amd64 --rm ...
If I replace the
docker run
part withpodman run --userns=keep-id
, so the command being executed is actually:exec podman run --userns=keep-id --platform linux/amd64 --rm ...
It seems to still work, but the problem is that every invocation of this script will try to pull the container image again.
We have a makefile to run thrift compiler against multiple thrift files. without the platform arg, it just runs smoothly like this:
But with the platform arg, it does this with podman:
Which makes things significantly slower (and also makes the console much more noisier)
We can, of course, just ask our devs using M1 Mac to set their environment variable as
DOCKER_RUN="docker run --platform linux/amd64"
, but since that arg is "harmless" in docker, it would be great if it can also be harmless in podman so we can just set it in the script by default.Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
: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)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: