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

Arm64 support for Apple Silicon chip #24

Open
j796160836 opened this issue Feb 14, 2022 · 5 comments
Open

Arm64 support for Apple Silicon chip #24

j796160836 opened this issue Feb 14, 2022 · 5 comments

Comments

@j796160836
Copy link

Hi,
Please add arm64 support although it's hello world project.
Busybox (base image) has support arm64. I think just rebuild it will be ok. Thanks.

$ docker run -d --rm --name web-test -p 80:8000 crccheck/hello-world
Unable to find image 'crccheck/hello-world:latest' locally

latest: Pulling from crccheck/hello-world
e685c5c858e3: Pull complete
7bf3c383dbcd: Pull complete
Digest: sha256:0404ca69b522f8629d7d4e9034a7afe0300b713354e8bf12ec9657581cf59400
Status: Downloaded newer image for crccheck/hello-world:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
2c49f324a4360331017a6fa3b42df665d71b315cd1edc49991446e6a318b696f
@crccheck
Copy link
Owner

sorry I don't know when I'll be able to get to this. I'm between computers right now and I kind of stopped using Docker CLI

@j796160836
Copy link
Author

j796160836 commented Feb 23, 2022

I solved in my fork.

https://github.com/j796160836/docker-simple-test-http
https://hub.docker.com/r/j796160836/simple-test-http


Here is new build command, you need to install buildx command.

https://docs.docker.com/buildx/working-with-buildx/

  1. Login to docker hub before build.
$ docker login

then enter your credentials.

  1. Build and push to registry, remember specify the architecture. (Don't forget the final dot. 🙂)
$ docker buildx build --push -t crccheck/hello-world:latest --platform linux/amd64,linux/arm64,linux/arm/v7 .

Check your docker hub's page, it will list multiple architecture in list.
By the way, don't use docker push command. It will upload only one architecture.

@crccheck
Copy link
Owner

I ended up installing Rancher Desktop (not Docker Desktop) on my M1 Mac and wasn't able to recreate the problem.

As for Docker Desktop users, maybe I can adjust the CI script to publish a buildx build

@cernoel
Copy link

cernoel commented Dec 1, 2022

you can try my image cernoel/hello-world:main .. if this works .. @crccheck might pull my changes in the publish.yaml to fix this? .. at least it works in my case for the ampere (arm64) servers.

@Huge
Copy link

Huge commented Mar 21, 2024

Notice that if you do not specify the platform, running may still fail. Good way: docker run --platform linux/arm64 -d -p 80:80 j796160836/simple-test-http

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

4 participants