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

distroless/base:debug doesn't work on Apple M1 #958

Closed
MrMYHuang opened this issue Feb 15, 2022 · 3 comments
Closed

distroless/base:debug doesn't work on Apple M1 #958

MrMYHuang opened this issue Feb 15, 2022 · 3 comments

Comments

@MrMYHuang
Copy link
Contributor

MrMYHuang commented Feb 15, 2022

Someones said Apple M1 doesn't support arm32:
https://news.ycombinator.com/item?id=27277351
However, Raspberry Pi 4 SoC supports both arm32 and arm64.

Container images claming with arm64 support but containing both arm32 and arm64 binaries DON'T work on Apple M1.
It seems that gcr.io/distroless/base:debug has the same problem.
On Ubuntu 21 arm64 on Parallels Desktop on Apple M1:
image

But on Ubuntu 20 arm64 on Raspberry Pi 4, it works well:
image

This problem causes some downstream images / apps won't work on Apple M1. For example, Tekton Pipeline:
https://github.com/tektoncd/pipeline/blob/dd3d0c24cd4870fce7d65ddc40a77d99fa8cab02/config/controller.yaml#L81

Please fix this problem. Thanks.

@MrMYHuang
Copy link
Contributor Author

I find the problem comes from busybox:

http_file(
name = "busybox_arm64",
executable = True,
sha256 = "141adb1b625a6f44c4b114f76b4387b4ea4f7ab802b88eb40e0d2f6adcccb1c3",
urls = ["https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv8l"],
)

The armv8l busybox binary is actually an arm32 one. I have sent a mail to busybox maillisting for help:
http://lists.busybox.net/pipermail/busybox/2022-February/089470.html

@loosebazooka
Copy link
Member

Right, this is actually a dupe of #657, please update there.

@MrMYHuang
Copy link
Contributor Author

Sorry, I find I was not very correct about the problem of distroless/base:debug with old armv8l busybox, because I find it works well on Docker on Apple M1. Please try this with Docker on Apple M1:

docker run -it gcr.io/distroless/base@sha256:cfdc553400d41b47fd231b028403469811fcdbc0e69d66ea8030c5a0b5fbac2b

However, it didn't work on Ubuntu 21 arm64 on Parallels Desktop on Apple M1. It would get this error

$ docker run -it gcr.io/distroless/base@sha256:cfdc553400d41b47fd231b028403469811fcdbc0e69d66ea8030c5a0b5fbac2b
standard_init_linux.go:228: exec user process caused: exec format error

Thus, the problem could not be what I said that was related to arm64 CPUs with no arm32 support.

Nevertheless, the arm64 busybox from docker-library does fix the "exec format error" problem on Ubuntu 21 arm64 on Parallels Desktop on Apple M1. Thus, the PR #960 is still meaningful.

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