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

Crun not starting in amd64/x86_64 docker container on Apple Silicon #1434

Open
fxgst opened this issue Mar 6, 2024 · 3 comments
Open

Crun not starting in amd64/x86_64 docker container on Apple Silicon #1434

fxgst opened this issue Mar 6, 2024 · 3 comments

Comments

@fxgst
Copy link

fxgst commented Mar 6, 2024

Description

When creating a simple Dockerfile that installs crun, setting the platform to linux/amd64, and then starting that container on an Apple Silicon (M2) laptop, crun immediately exits printing Failed to re-execute libcrun via memory file descriptor, likely coming from here.

When removing the --platform=linux/amd64, starting crun works as expected.

Steps to reproduce

Make sure you have an Apple Silicon device with docker and rosetta installed.
I could not reproduce this on amd64.

Here is the Dockerfile:

FROM --platform=linux/amd64 ubuntu:20.04

RUN apt-get update 
RUN apt-get install -yqq crun

Build the docker image with docker build . -t test
Run it with docker run -it test, and when the shell opens, type crun and hit enter.

@leonpano2006
Copy link

I think amd64 images are not meant to run via Rosetta
They should be meant running with emulation or virtualization if is aarch64/arm64 images since
Unless you are on Linux bare metal

@fxgst
Copy link
Author

fxgst commented Mar 15, 2024

Native arm64 images cause issues with amd64 binaires so often the solution is to build the whole image for amd64, they get translated fine by Rosetta. But crun was the first binary that I found not to work in such a setting. Maybe something to look into for you

@leonpano2006
Copy link

Native arm64 images cause issues with amd64 binaires so often the solution is to build the whole image for amd64, they get translated fine by Rosetta. But crun was the first binary that I found not to work in such a setting. Maybe something to look into for you

why you should use amd64 binaries?
what software do you want to run?
i think most of linux software is cross arch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants