Last active
January 27, 2024 02:06
-
-
Save xxxbrian/7d10ba2a553b6854ef3abdead6881790 to your computer and use it in GitHub Desktop.
Cross-Platform Rust Build Script with Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# x86_64 Linux | |
docker run --rm \ | |
--platform=linux/amd64 \ | |
--user "$(id -u)":"$(id -g)" \ | |
-v "$PWD":/usr/src/myapp \ | |
-w /usr/src/myapp \ | |
rust:latest \ | |
cargo build --release --target x86_64-unknown-linux-gnu | |
# aarch64 Linux | |
docker run --rm \ | |
--platform=linux/arm64 \ | |
--user "$(id -u)":"$(id -g)" \ | |
-v "$PWD":/usr/src/myapp \ | |
-w /usr/src/myapp \ | |
rust:latest \ | |
cargo build --release --target aarch64-unknown-linux-gnu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment