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
Don't pass --platform to docker/podman #2511
Conversation
d1123c0
to
28242f3
Compare
dfd6a02
to
78a7c9a
Compare
bf316ab
to
968e811
Compare
The `--platform` flag is only ever passed to docker/podman when both the user and server platform values are equal. When they mismatch, the `--platform` flag is ommitted, and the server's native platform is used. Since the `--platform` value is only ever passed when the user and server platforms are equal, it shouldn't matter; however in practice there is a podman bug, which causes a pull to occur whenver the `--platform` flag is specified: containers/podman#15711 This bug will cause podman to always pull the earthly/buildkitd image from docker hub, which will either 1) overwrite the local image if the image exists in docker hub, and ultimately will cause our tests to run against an incorrect image version, or 2) result in the following 404-error if the tag does not exist: exit status 125: Trying to pull docker.io/earthly/buildkitd:dev-HEAD... Error: initializing source docker://earthly/buildkitd:dev-HEAD: reading manifest dev-HEAD in docker.io/earthly/buildkitd: manifest unknown: manifest unknown: exit status 125 This commit additionally updates the podman tests to use capsh rather than grep for the `RUN --privileged` tests, as the Effective capabilities (CapEff) bits are not always the same between docker and podman Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
968e811
to
d55f84c
Compare
I tested this on the m1: under
Then I ran:
which produced
|
and when running on the
|
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.
Everything seems reasonable to my (untrained) eyes. I particularly like the capsh changes to scrap the magic hex value.
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.
Relying on the default behaviour (letting the Docker / Podman server choose the platform) makes sense.
The first change (only adding platform if they matched) was a conservative change since I was new to the area. I don't recall there being a better reason.
There is another tiny thing we could cleanup in this PR; the FrontendInformation
function is being added to the shellFrontend
structure and we no longer need it.
FrontendInformation func(ctx context.Context) (*FrontendInfo, error) |
The
--platform
flag is only ever passed to docker/podman when both theuser and server platform values are equal. When they mismatch, the
--platform
flag is ommitted, and the server's native platform is used.Since the
--platform
value is only ever passed when the user andserver platforms are equal, it shouldn't matter; however in practice
there is a podman bug, which causes a pull to occur whenver the
--platform
flag is specified: containers/podman#15711This bug will cause podman to always pull the earthly/buildkitd image from
docker hub, which will either 1) overwrite the local image if the image exists in docker hub,
and ultimately will cause our tests to run against an incorrect image
version, or 2) result in the following 404-error if the tag does not
exist:
This commit additionally updates the podman tests to use capsh rather
than grep for the
RUN --privileged
tests, as the Effective capabilities (CapEff)bits are not always the same between docker and podman
Signed-off-by: Alex Couture-Beil alex@earthly.dev