Skip to content

Instantly share code, notes, and snippets.

@NamPNQ
Last active July 31, 2020 06:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NamPNQ/a7efe3ac6b7f505a94cf6b574127f498 to your computer and use it in GitHub Desktop.
Save NamPNQ/a7efe3ac6b7f505a94cf6b574127f498 to your computer and use it in GitHub Desktop.
RUST cross-compiling from Ubuntu to Windows using docker
  1. Go to your project
$ docker run -it --rm `pwd`:/opt/app rust bash
  1. Build
$ apt update && apt install mingw-w64 -y
$ rustup update
$ rustup target add x86_64-pc-windows-gnu
$ cargo build --target x86_64-pc-windows-gnu --release
  1. Wait and pray for it will not build failed. Good luck!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment