Start9Labs / hello-world-startos

wrapper for building a [service].s9pk
MIT License
13 stars 15 forks source link

Won't compile on macOS with Apple Silicon M1 #17

Open k0gen opened 2 years ago

k0gen commented 2 years ago

When building on Mac with Apple Silicon the arm64 version of rust-musl-cross is not available:

% make
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "/Users/k0gen/Dev/hello-world-wrapper"/hello-world:/home/rust/src start9/rust-musl-cross:aarch64-musl cargo +beta build --release
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I'm building it manually from https://github.com/Start9Labs/rust-musl-cross

BayMax-1010 commented 1 year ago

M1 Mac Build Failed!

docker buildx build --tag start9//main: --build-arg ARCH=aarch64 --platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar .
[+] Building 1.4s (1/1) FINISHED                                                
 => [internal] booting buildkit                                            1.3s
 => => starting container buildx_buildkit_epic_einstein0                   1.3s
ERROR: invalid tag "start9//main:": invalid reference format
make: *** [docker-images/aarch64.tar] Error 1
make: *** Deleting file `docker-images/aarch64.tar'
chrisguida commented 1 year ago

@BayMax-1010

Please follow the instructions in the README. Your docker buildx command is malformed.

Also, you can build the arm64 version of rust-musl-cross by cloning the repo and running ./build.sh.

@dr-bonez can we add the arm64 version of rust-musl-cross to dockerhub please?