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

On M1 systems, commands for running amd64 images are corrupted #2659

Closed
thedadams opened this issue Jul 29, 2022 · 11 comments · Fixed by #2680
Closed

On M1 systems, commands for running amd64 images are corrupted #2659

thedadams opened this issue Jul 29, 2022 · 11 comments · Fixed by #2680
Assignees
Labels
kind/bug Something isn't working platform/macos
Projects
Milestone

Comments

@thedadams
Copy link

Actual Behavior

Passing commands at the end of a docker run command doesn't work as expected.

Steps to Reproduce

Running the following command docker run --rm --platform linux/amd64 --entrypoint ls busybox -lR /.

Result

The output is: lR: applet not found

Expected Behavior

The output of running ls -lR / (which is a lot) should be produced.

Additional Information

Running docker run --rm --entrypoint ls busybox -lR / (without the --platform flag) works as expected.

Additionally, running docker run --rm --platform linux/amd64 --entrypoint ls busybox -lR / using Docker Desktop works as expected (just for reference as to why I see this as a bug).

Rancher Desktop Version

1.5.0

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

Monterey 12.5

What CPU architecture are you using?

arm64 (Apple Silicon)

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

@thedadams thedadams added the kind/bug Something isn't working label Jul 29, 2022
@github-actions github-actions bot added this to To do in Stripey via automation Jul 29, 2022
@jandubois
Copy link
Member

I can confirm this.

The issue is with the cross-platform emulation, as docker run --rm --platform linux/arm64 --entrypoint ls busybox -lR / runs fine. And on an Intel Mac it is the other way around (the --platform linux/arm64 shows the error, but --platform linux/amd64 works fine).

@jandubois jandubois self-assigned this Jul 29, 2022
@jandubois jandubois added this to the Next milestone Jul 29, 2022
@jandubois
Copy link
Member

I've confirmed that this is a regression from Rancher Desktop 1.4.1.

It affects both docker and nerdctl.

When I copy the alpine-lima ISO from 1.4.1 over the basedisk (while RD 1.5.0 is stopped), then the commands work again after starting RD once again.

So I expected this to be related to the update of containerd from 1.5.1 to 1.6.6. But things work fine with 1.6.6 with pure Lima, both with the default Ubuntu VM, but also with the "standard" alpine-lima image. And this is with identical docker versions (20.10.16). So I don't know what might be causing this.

@jandubois
Copy link
Member

but also with the "standard" alpine-lima image.

Actually no, I was running the amd64 image on an Intel mac, so that was expected to pass. Running the arm64 image failed with plain Lima and the standard alpine image:

$ limactl start template://alpine
[...]
$ limactl shell alpine sudo -i
lima-alpine:~# apk add docker
[...]
OK: 251 MiB in 81 packages
lima-alpine:~# rc-service docker start
 * Caching service dependencies ...                                                                                   [ ok ]
 * /var/log/docker.log: creating file
 * /var/log/docker.log: correcting owner
 * Starting Docker Daemon ...                                                                                         [ ok ]
lima-alpine:~# docker run --rm --platform linux/arm64 --entrypoint ls busybox -lR /
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
98b248744137: Pull complete
Digest: sha256:0e97a8ca6955f22dbc7db9e9dbe970971f423541e52c34b8cb96ccc88d6a3883
Status: Downloaded newer image for busybox:latest
lR: applet not found

@jandubois
Copy link
Member

I was hoping to do some bisecting on the changes between alpine-lima 0.2.17 and 0.2.18. There are only a few changes there, and it very much looks like one of them is responsible for this regression.

@danganea
Copy link

danganea commented Aug 2, 2022

Also affects previous images that have only an amd64 image but previously worked via emulation.

docker run --rm -it  mcr.microsoft.com/azure-storage/azurite

docker-entrypoint.sh: applet not found

@knkarthik
Copy link

Same for me. I could run mysql:5.7.37 on Mac M1 with Rancher 1.4 but not with 1.5

docker run --platform linux/amd64 docker.io/mysql:5.7.37
/usr/sbin/mysqld: /usr/sbin/mysqld: cannot execute binary file

@ericpromislow
Copy link
Contributor

I'm WFH only on an amd64 macOS machine, but can't run

docker run --rm --platform linux/arm64 --entrypoint ls busybox -lR /

with both Rancher Desktop 1.4.1 and 1.5.0. I'm not sure if this is even supported. Is it possible that the emulation is only one way (for running an amd64 image on an arm64 host)?

@ericpromislow ericpromislow removed their assignment Aug 3, 2022
@gaktive
Copy link
Contributor

gaktive commented Aug 3, 2022

Might be related to the M1 chip.

@ericpromislow ericpromislow changed the title Changing the platform and passing commands produces strange output On M1 systems, commands for running amd64 images appear corrupted Aug 4, 2022
@ericpromislow ericpromislow changed the title On M1 systems, commands for running amd64 images appear corrupted On M1 systems, commands for running amd64 images are corrupted Aug 4, 2022
@gaktive gaktive assigned mook-as and unassigned ericpromislow Aug 4, 2022
@gaktive gaktive modified the milestones: Next, Patch Aug 4, 2022
@gaktive gaktive moved this from To do to In progress in Stripey Aug 4, 2022
@mook-as mook-as moved this from In progress to Review in Stripey Aug 5, 2022
@oidualc
Copy link

oidualc commented Aug 5, 2022

Is there a workaround to use Rancher Desktop 1.5.0 while this is getting fixed in the next release?

@ripun

This comment was marked as duplicate.

@mook-as
Copy link
Contributor

mook-as commented Aug 5, 2022

Please see #2668 (comment) for a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/macos
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

9 participants