# apk add rustup # rustup-init -y ... error: linker `cc` not found | = note: No such file or directory (os error 2) ... error: build failed The command '/bin/sh -c cargo build' returned a non-zero code: 101
# apk add rustup # #apk add gcc # here or # apk add build-base # here # rustup-init -y info: profile set to 'default' info: default host triple is x86_64-unknown-linux-musl info: syncing channel updates for 'stable-x86_64-unknown-linux-musl' info: latest update on 2021-02-11, rust version 1.50.0 (cb75ad5db 2021-02-10) info: downloading component 'cargo' info: downloading component 'clippy' info: downloading component 'rust-docs' info: downloading component 'rust-std' info: downloading component 'rustc' info: installing component 'rustfmt' info: default toolchain set to 'stable-x86_64-unknown-linux-musl' stable-x86_64-unknown-linux-musl installed - rustc 1.50.0 (cb75ad5db 2021-02-10) Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell, run: source $HOME/.cargo/env
As to Dockerfile, adding
after the installation might bring a little more happiness.
The minimal installation requires, of course, just
gcc instead of
build-base. It is, however, not recommended because either
libc-dev will be necessary in addition soon after.
In my case, installing Rust only was successful with
gcc, but Actix Web, a Rust web framework using actors communication, required
- Alpine Linux 3.13
- Rust 1.50
- Rustup 1.23