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

[BUG]: Containers can't be build on M1 #19

Open
studentofcoding opened this issue Sep 21, 2022 · 14 comments
Open

[BUG]: Containers can't be build on M1 #19

studentofcoding opened this issue Sep 21, 2022 · 14 comments
Labels
type: bug Something isn't working

Comments

@studentofcoding
Copy link

Project

Installation process

Lesson Number

Issue/Experience

I think it only supports linux for now?

Code and Screenshots


=> ERROR [13/19] RUN sh -c "$(curl -sSfL https://release.solana.com/stab  2.2s
------                                                                          
 > [13/19] RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)": 
#0 1.247 downloading stable installer
#0 2.198 curl: (22) The requested URL returned error: 403 
#0 2.205 solana-install-init: command failed: downloader https://release.solana.com/stable/solana-install-init-aarch64-unknown-linux-gnu /tmp/tmp.M3vwjj3cRL/solana-install-init
------
ERROR: failed to solve: executor failed running [/bin/sh -c sh -c "$(curl -sSfL https://release.solana.com/stable/install)"]: exit code: 1
@ShaunSHamilton
Copy link
Member

Thank you for taking the time to open this.

This is odd, because the solana cli is being installed on Linux (Ubuntu20.04). This is the whole point of using Docker.

I will investigate this further, but it seems the issue has to do with the curl request being blocked by your workspace. I suggest seeing if you can access the URL in your browser.

I would double-check your DNS settings as well as firewall which could be blocking the request.

@ShaunSHamilton ShaunSHamilton transferred this issue from freeCodeCamp/web3-curriculum Sep 21, 2022
@laitsky
Copy link

laitsky commented Sep 22, 2022

Facing the similar issue as well on M1, looks like this is ARM-specific problem since there's a dude on Discord getting the same trouble.

@ojasuno
Copy link

ojasuno commented Sep 23, 2022

docker-inocmpatible-error

has anyone run into docker issue, when running on the new M1

@ojasuno
Copy link

ojasuno commented Sep 23, 2022

managed to resolve above Docker issue, not getting stuck here, when it is building the Dockerfile

 => ERROR [13/19] RUN sh -c "$(curl -sSfL https://release.solana.com/stab  2.1s
                                                                
[2022-09-23T08:37:26.179Z]                 
                                                                                
------
 > [13/19] RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)":
#0 1.116 downloading stable installer
#0 2.022 curl: (22) The requested URL returned error: 403 
#0 2.043 solana-install-init: command failed: downloader https://release.solana.com/stable/solana-install-init-aarch64-unknown-linux-gnu /tmp/tmp.TLQ5Qw4STt/solana-install-init
------
[2022-09-23T08:37:26.179Z] ERROR: failed to solve: executor failed running [/bin/sh -c sh -c "$(curl -sSfL https://release.solana.com/stable/install)"]: exit code: 1

@ShaunSHamilton
Copy link
Member

While we are still looking for a fix, we suggest running the course in Gitpod:

NOTE: The course tools are complex, and we have not confirmed every project/lesson will work in Gitpod either.

gitpod-web3.mp4

@ShaunSHamilton ShaunSHamilton added the type: bug Something isn't working label Sep 23, 2022
@ojasuno
Copy link

ojasuno commented Sep 23, 2022

a workaround for now, i downloaded the install file and changed the Dockerfile to execute it locally

# Solana
#RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
CMD install

@scissorsneedfoodtoo
Copy link

Did some testing on my M1 Air last week and ran into this issue as well.

I believe it's because Solana's install script takes the container's CPU type into account when deciding which version to download and install. And it seems that, unless a platform is specified, Docker will try to pull an Ubuntu image that's closest to the host's CPU type, which for M1 is aarch64 / ARM64.

Then for Solana, it turns out there are no prebuilt aarch64 version for Linux, just x86_64 / amd64. There are other aarch64 builds, but only for Apple machines: https://github.com/solana-labs/solana/releases/tag/v1.14.2

It's possible to force Docker to build a container using x86_64 Ubuntu with FROM --platform=linux/amd64 ubuntu:20.04. This seems to work, and Solana can install properly while building the container and in one of the early lesson steps.

But once you hit the solana-test-validator step, you'd probably get the following error message: Incompatible CPU detected: missing AVX support. Please build from source on the target.

Turns out that M1 / M2 CPUs don't support AVX or AVX2 instructions, which solana-test-validator uses under the hood. It should be possible to compile Solana from source to get around that, but I ran into some issues while doing that inside the x86_64 Ubuntu container.

The easiest thing for people with M1 / M2 machines to do would be to use GitPod or something similar like @ShaunSHamilton mentioned. Then the container should be built on an x86 machine, and shouldn't run into the same issue with solana-test-validator and the lack of AVX2 support.

@guycode
Copy link

guycode commented Sep 26, 2022

failing install on new M1 as well with devcontainer.json.

@codingxjourney
Copy link

[2022-10-22T18:26:00.652Z] l https:// 0.0s
=> ERROR [dev_container_auto_added_stage_label 13/19] RUN sh -c "$(curl 3.6s

[dev_container_auto_added_stage_label 13/19] RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)":
#0 1.477 downloading stable installer
#0 3.600 curl: (22) The requested URL returned error: 403
#0 3.609 solana-install-init: command failed: downloader https://release.solana.com/stable/solana-install-init-aarch64-unknown-linux-gnu /tmp/tmp.snPZp3xpUo/solana-install-init


[2022-10-22T18:26:00.652Z] ERROR: failed to solve: executor failed running [/bin/sh -c sh -c "$(curl -sSfL https://release.solana.com/stable/install)"]: exit code: 1
[2022-10-22T18:26:00.657Z] Stop (9533 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/xk/7pnplynn383f5ld8wbd2t_8r0000gn/T/devcontainercli/container-features/0.20.0-1666463151087/Dockerfile-with-features -t vsc-solana-curriculum-00a53c8e8217084823e448bec660d7f9 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/xk/7pnplynn383f5ld8wbd2t_8r0000gn/T/devcontainercli/container-features/0.20.0-1666463151087 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/codingxjourney/solana-curriculums/solana-curriculum
[2022-10-22T18:26:00.658Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/xk/7pnplynn383f5ld8wbd2t_8r0000gn/T/devcontainercli/container-features/0.20.0-1666463151087/Dockerfile-with-features -t vsc-solana-curriculum-00a53c8e8217084823e448bec660d7f9 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/xk/7pnplynn383f5ld8wbd2t_8r0000gn/T/devcontainercli/container-features/0.20.0-1666463151087 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/codingxjourney/solana-curriculums/solana-curriculum
[2022-10-22T18:26:00.658Z] at Vse (/Users/username/.vscode/extensions/ms-vscode-remote.remote-containers-0.255.4/dist/spec-node/devContainersSpecCLI.js:1869:1635)
[2022-10-22T18:26:00.658Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

@duy211099
Copy link

a workaround for now, i downloaded the install file and changed the Dockerfile to execute it locally

# Solana
#RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
CMD install

it's worked. Thank you!

@branddesade
Copy link

a workaround for now, i downloaded the install file and changed the Dockerfile to execute it locally

# Solana
#RUN sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
CMD install

it's worked. Thank you!

not working for me

@ShaunSHamilton
Copy link
Member

@branddesade What errors can you see in the logs?

@zzz6519003
Copy link

works on my windows but not my m1 mac too

@eric-gg
Copy link

eric-gg commented Nov 15, 2024

This really needs a fix, Mac M\d based machines aren't exactly rare in the dev community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests