Created
July 11, 2022 19:27
-
-
Save st0le/c6964eb3efdfa043e1df325acb34fa6b to your computer and use it in GitHub Desktop.
Build Rust projects without installing rust. (use a docker container)
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
FROM rust:latest | |
RUN apt update && apt upgrade -y | |
RUN apt install -y g++-mingw-w64-x86-64 | |
RUN rustup target add x86_64-pc-windows-gnu | |
RUN rustup toolchain install stable-x86_64-pc-windows-gnu | |
WORKDIR /app | |
CMD ["cargo", "build", "--release", "--target", "x86_64-pc-windows-gnu"] | |
# docker build . -t rust_cross_compile/windows -f Dockerfile.windows | |
# docker run --rm -ti -v "$($pwd):/app" rust_cross_compile/windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment