Hi folks,
I’m a Rust noob but competent with Linux and Python.
My goal is to build a Rust static binary and get it to run on Alpine Linux (or second preference Tiny Core Linux or Yocto Linux)
This is what I am trying to make work:
https://rocket.rs/guide/getting-started/#hello-world
But whenever I copy the binary file to the target OS and run it, I get:
‘No such file or directory’
I build on a clean Ubuntu 16 setup with these commands:
apt update
apt install rust
wget https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
chmod +x rustup-init
./rustup-init
source $HOME/.cargo/env
rustup default nightly
rustup update
cargo update
cargo new hello-rocket --bin
cd hello-rocket
vi Cargo.toml
apt-get install build-essential
cargo run
ROCKET_ENV=production
rustup target add x86_64-unknown-linux-musl
apt install musl-tools
cargo build --release --target x86_64-unknown-linux-musl
I’ve spent all day on this and tried everything I can think of but nothing works.
Is there anyone who has managed to get Rust code to run on Alpine Linux?
If yes, can you help me find what I am doing wrong?
thanks