crun icon indicating copy to clipboard operation
crun copied to clipboard

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

Open fxgst opened this issue 11 months ago • 3 comments

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.

fxgst avatar Mar 06 '24 09:03 fxgst

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

leonpano2006 avatar Mar 12 '24 07:03 leonpano2006

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

fxgst avatar Mar 15 '24 19:03 fxgst

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

leonpano2006 avatar Mar 15 '24 20:03 leonpano2006