-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Latest 3.10-slim-bullseye fails on Macbook M1 with Rosetta emulation #792
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
Comments
We're setting |
This is not just 3.10-slim-bullseye. It happens for alpine, non-slim and different Python versions.
The Sometimes I get a seg fault instead of a rosetta error.
|
I can't reproduce with QEMU's emulation, so this has to be a bug in Rosetta -- does anyone know where would be an appropriate place to raise/file that? |
Before sending feedback to Apple, I think there's one more test to do: execute an x86_64 binary with similar modifications directly on an ARM-based Mac, without Docker. If that test passes then it may be a Docker issue or a Virtualization.framework issue. If that test fails, it is a Rosetta issue. (This is not my area of expertise at all so I have no idea how to do that) |
Nice idea @rik. Unfortunately macOS doesn't use ELF. It uses the Mach-O format1.
It turns out what I was seeing in the Rosetta error message was the first four bytes of an ELF, which are the ELF magic number Footnotes |
Using Dockerfile
# syntax = docker/dockerfile:1
FROM debian:bullseye
SHELL [ "/bin/bash", "-c", "-x" ]
RUN <<END_RUN
apt-get update
apt-get install -y --no-install-recommends gcc libc6-dev patchelf elfutils
rm -rf /var/lib/apt/lists/*
END_RUN
RUN <<END_RUN
cat <<END_OF_C >hello.c
#include <stdio.h>
int main() {
printf("Hello world\n");
}
END_OF_C
gcc -o hello hello.c
./hello
patchelf --print-rpath hello
patchelf --set-rpath '$ORIGIN/../lib' --output patched-hello hello
patchelf --print-rpath patched-hello
patchelf --remove-rpath patched-hello
patchelf --print-rpath patched-hello
diff -u <(eu-readelf -h -d hello) <(eu-readelf -h -d patched-hello)
eu-readelf -l hello
eu-readelf -l patched-hello
./hello
./patched-hello
END_RUN
docker buildx build --platform=linux/amd64 --progress=plain .
|
@jimnicholls Thank you very much for working on this. I've just confirmed it fixed the issue for me with the latest tag. |
Description
I am using Python image with amd64 platform flag on an arm64 host with a recent experimental feature from Docker : Rosetta emulation.
Recents changes #785 and #790 appear to have broken latest 3.10-slim-bullseye tag
Steps to reproduce
docker build .
Output from
docker build
docker info
The text was updated successfully, but these errors were encountered: