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
Buildah in podman - Wrong architecture for base image in multistage build #4742
Comments
As a workaround, tweaking the Dockerfile to pull the foreign arch first does work:
Then I guess that the issue is that |
Hi @pini-gh , The issue happens because buildah's cache mechanism only considers history not the original architecture requested, I guess this can be fixed at buildah end, thanks for creating the issue and reporting :) I'll check this. |
A friendly reminder that this issue had no activity for 30 days. |
@flouthoc any update? |
The build runs in two stages: 1. Cross compilation for target architecture on native arch image 2. Installation into target architecture image Currently it requires a third stage to workaround an issue in podman/buildah: containers/buildah#4742 Configuring a gitlab-runner with podman: 1. Follow this documentation: https://docs.gitlab.com/runner/executors/docker.html#use-podman-to-run-docker-commands 2. Install the `crun` and `qemu-user-static` packages
A friendly reminder that this issue had no activity for 30 days. |
Description
I've successfully set up a gitlab runner after this documentation.
It works great for single-stage Dockerfile, but when building multistage for a foreign architecture it pulls the wrong arch image at the final stage.
Note: single stage builds are OK.
Steps to reproduce the issue:
My box runs Debian testing amd64. The current podman version is 4.3.1. The package
qemu-user-static
is installed.Set up a new
buildah-issue
directory with this Dockerfile:This tow stages Dockerfile is written after this Docker documentation:
Run
quay.io/buildah/stable
with this folder mountedEnter the mounted volume and build with
--layers --platform linux/amd64
Do the same with
--layers --platform linux/arm64
Describe the results you received:
When building for
linux/arm64
at the second stage every layer is pulled from the cache after thelinux/amd64
build, and the resulting image is the very same as thelinux/amd64
one:Describe the results you expected:
The second stage base image should have pulled the
linux/arm64
debian:bullseye-slim
image from docker.io registry instead of pulling thelinux/amd64
one from the cache.Output of
buildah version
:As said above I use buildah from image
quay.io/buildah/stable
. In this context:Output of
podman version
on the hostOutput of
cat /etc/*release
:Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:No such file. I don't think this is relevant in this context anyway.
The text was updated successfully, but these errors were encountered: