Skip to content
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

podman default machine on macOS M1/M2 could ship qemu-user-static out of the box to use non-ARM64 containers #16148

Closed
XVilka opened this issue Oct 13, 2022 · 3 comments
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related stale-issue

Comments

@XVilka
Copy link

XVilka commented Oct 13, 2022

Ship the qemu-user-static out of the box on podman machine installations of Fedora to allow non-arm64 builds out of the box

Currently it needs installing it manually:

podman machine ssh
sudo -i
rpm-ostree install qemu-user-static
systemctl reboot

See https://edofic.com/posts/2021-09-12-podman-m1-amd64/

It would certainly simplify things if the standard podman machine image for macOS installations would provide them by default. Running x86 containers on M1 is very common task.

Moreover, it still doesn't solve the problem of building these images:

podman build .

When Dockerfile contains:

FROM arm32v7/alpine:3.16
RUN apk update

produces:

STEP 1/10: FROM arm32v7/alpine:3.16
WARNING: image platform ({arm linux  [] v7}) does not match the expected platform ({arm64 linux  [] })
STEP 2/10: RUN apk update
exec container process `/bin/sh`: Exec format error
Error: error building at STEP "RUN apk update": error while running runtime: exit status 1

If I run image ARM32v7 directly, it also fails:

ℤ podman run --rm -it docker.io/arm32v7/alpine:3.16 sh
WARNING: image platform ({arm linux  [] v7}) does not match the expected platform ({arm64 linux  [] })
{"msg":"exec container process `/bin/sh`: Exec format error","level":"error","time":"2022-10-13T04:54:54.000271348Z"}

Meanwhile x86_64 image boots fine:

podman run --rm -it docker.io/amd64/alpine:3.16 sh
Trying to pull docker.io/amd64/alpine:3.16...
Getting image source signatures
Copying blob sha256:213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49
Copying config sha256:9c6f0724472873bb50a2ae67a9e7adcb57673a183cea8b06eb778dca859181b5
Writing manifest to image destination
Storing signatures
WARNING: image platform ({amd64 linux  [] }) does not match the expected platform ({arm64 linux  [] })
/ # uname -a
Linux 0a00ab3e2b79 5.19.12-200.fc36.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Sep 28 17:04:53 UTC 2022 x86_64 Linux/ # apk add file
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/2) Installing libmagic (5.41-r0)
(2/2) Installing file (5.41-r0)
Executing busybox-1.35.0-r17.trigger
OK: 13 MiB in 16 packages
/ # which file
/usr/bin/file
/ # file /bin/busybox
/bin/busybox: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped
/ # file $(which file)
/usr/bin/file: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

Also S390x boots just fine:

podman run --rm -it docker.io/s390x/alpine:3.16 sh
Trying to pull docker.io/s390x/alpine:3.16...
Getting image source signatures
Copying blob sha256:790c84f1f3409eab952345157df7fa804ba6b5f06d4ceb6f2dfa3c6de2064397
Copying config sha256:4d0c95c8f9f7c6363ffe08596a1c6a624f3bf59d61a663083a816b59cb2e47f1
Writing manifest to image destination
Storing signatures
WARNING: image platform ({s390x linux  [] }) does not match the expected platform ({arm64 linux  [] })
/ # uname -a
Linux 55cd14943f2b 5.19.12-200.fc36.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Sep 28 17:04:53 UTC 2022 s390x Linux
/ # apk add file
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/s390x/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/s390x/APKINDEX.tar.gz
(1/2) Installing libmagic (5.41-r0)
(2/2) Installing file (5.41-r0)
Executing busybox-1.35.0-r17.trigger
OK: 13 MiB in 16 packages
/ # file $(which file)
/usr/bin/file: ELF 64-bit MSB pie executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-s390x.so.1, stripped
/ #

RISC-V fails for different reasons (https://hub.docker.com/r/riscv64/alpine/):

 podman run --rm -it docker.io/riscv64/alpine:3.16 sh
Trying to pull docker.io/riscv64/alpine:3.16...
Error: initializing source docker://riscv64/alpine:3.16: reading manifest 3.16 in docker.io/riscv64/alpine: manifest unknown: manifest unknown

PPC64LE works fine:

podman run --rm -it docker.io/ppc64le/alpine:3.16 sh
Trying to pull docker.io/ppc64le/alpine:3.16...
Getting image source signatures
Copying blob sha256:c79e5d1a8c89b87020a754c8a5c8370faaa37bfb5bca1d8af66770d522ef1caf
Copying config sha256:520cf2ab7c1a1ba979e7d20c8ad2b433d119288ba0b88660a0afdca28f41afb3
Writing manifest to image destination
Storing signatures
WARNING: image platform ({ppc64le linux  [] }) does not match the expected platform ({arm64 linux  [] })
/ # uname -a
Linux 6d49549f8e6e 5.19.12-200.fc36.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Sep 28 17:04:53 UTC 2022 ppc64le Linux
/ # apk add file
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ppc64le/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/ppc64le/APKINDEX.tar.gz
(1/2) Installing libmagic (5.41-r0)
(2/2) Installing file (5.41-r0)
Executing busybox-1.35.0-r17.trigger
OK: 14 MiB in 16 packages
/ # file $(which file)
/usr/bin/file: ELF 64-bit LSB pie executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-powerpc64le.so.1, stripped

Versions

Podman

podman version
Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.6
Built:        Wed Sep  7 03:16:02 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.5
Built:        Thu Sep  8 03:59:25 2022
OS/Arch:      linux/arm64

Homebrew podman package information:

brew info podman
==> podman: stable 4.2.1 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/4.2.1 (178 files, 48MB) *
  Poured from bottle on 2022-09-08 at 08:52:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go-md2man ✘, [email protected] ✘
Required: qemu ✔
==> Options
--HEAD
        Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 20,082 (30 days), 64,183 (90 days), 212,333 (365 days)
install-on-request: 19,372 (30 days), 62,488 (90 days), 210,270 (365 days)
build-error: 0 (30 days)

MacOS

sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
@github-actions github-actions bot added the macos MacOS (OSX) related label Oct 13, 2022
@afbjorklund
Copy link
Contributor

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Nov 14, 2022

I believe we do do this now.

@rhatdan rhatdan closed this as completed Nov 14, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants