containers / containers/crun

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

Open
#1,434 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4.1k
Forks
444
Avg merge
1d 18h
Merged PRs (30d)
43

Description

# 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](https://github.com/containers/crun/blob/64ee22ce09e2879eaf346fd3bd03806a64b4acd6/src/crun.c#L382).

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.