redhat-developer / podman-desktop-redhat-account-ext

Podman Desktop Red Hat Account Extension
Apache License 2.0
3 stars 9 forks source link

Cannot build an image using ARM64 platform when on Windows AMD64 #112

Closed odockal closed 5 months ago

odockal commented 5 months ago

I am trying to build an image using container file from readme. When I am on amd64 arch (win 10) and I try to build an image also for arm64 it fails for me:

Uploading the build context from C:/Users/Ondrej/git/podman-desktop-qe/examples/images...Can take a while...
Building quay.io/odockal/rhel9-toolbox...
STEP 1/2: FROM registry.redhat.io/rhel9/toolbox
Trying to pull registry.redhat.io/rhel9/toolbox:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob sha256:9dce62ae36826732e363f071223145b56e646fae1825df47a38f68ac9f74a2a3
Copying blob sha256:0af708ca56aa0f8f6981a42770d4f78c2499c7bc5928caa1a0475658fc31ace2
Copying config sha256:d711a88ca549bc258e20bb7549e5fe7fb1604b0390caaed6fb535ae3beaf9202
Writing manifest to image destination
Storing signatures
STEP 2/2: RUN dnf install -y kernel
exec container process `/bin/sh`: Exec format error
Error:building at STEP "RUN dnf install -y kernel": while running runtime: exit status 1

Steps to reproduce:

  1. Install podman desktop (1.10.0-next version from 2024-04-16)
  2. Install sso extension (latest)
  3. Sign in using SSO
  4. ASSERT: registry added, system subscribed (check tasks)
  5. Create a containerfile, ie:
    FROM registry.redhat.io/rhel9/toolbox
    RUN  dnf install -y kernel
  6. Build an image using this containerfile
  7. Choose an ARM64 platform to build image
  8. Assert: image successfully built Actual result: error, see above

Building image on both target architectures/platforms at once also fails:

Uploading the build context from C:/Users/Ondrej/git/podman-desktop-qe/examples/images...Can take a while...
Error:(HTTP code 400) unexpected - failed to parse query parameter 'platform': "linux/amd64,linux/arm64": invalid platform syntax for --platform="linux/amd64,linux/arm64": "amd64,linux" is an invalid component of "linux/amd64,linux/arm64": platform specifier componeError:Error: (HTTP code 400) unexpected - failed to parse query parameter 'platform': "linux/amd64,linux/arm64": invalid platform syntax for --platform="linux/amd64,linux/arm64": "amd64,linux" is an invalid component of "linux/amd64,linux/arm64": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument 
vrothberg commented 5 months ago

Does it also fail with another Dockerfile?

FROM fedora:39
RUN dnf install -y vim

Also cross-build to ARM64 on AMD64.

vrothberg commented 5 months ago

Error:(HTTP code 400) unexpected - failed to parse query parameter 'platform': "linux/amd64,linux/arm64": invalid platform syntax for --platform

Ah, could it be that you selected both architectures at the same time? That is a (known) bug. If so, please select only one at a time.

vrothberg commented 5 months ago

Must be hitting https://github.com/containers/podman-desktop/issues/6236.

Before closing, let's re-verify that cross-build works on Windows.

odockal commented 5 months ago

Does it also fail with another Dockerfile?

FROM fedora:39
RUN dnf install -y vim

Also cross-build to ARM64 on AMD64.

That is what I tried, building ARM on actual AMD64 system. The result is the same. I cannot cross build.

Error:(HTTP code 400) unexpected - failed to parse query parameter 'platform': "linux/amd64,linux/arm64": invalid platform syntax for --platform

Ah, could it be that you selected both architectures at the same time? That is a (known) bug. If so, please select only one at a time.

Yes. Selecting both at the same time. I know about the issue on podman-desktop side, just wanted to make sure you also know about it.

vrothberg commented 5 months ago

Thanks! Closing as it's a bug in Podman Desktop.