-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cc5b87
commit b07b464
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM rust:1.34 | ||
LABEL Description="Rust compile env for linux + windows (cross)" | ||
|
||
RUN apt update | ||
RUN apt install -y build-essential mingw-w64 | ||
|
||
RUN rustup target add x86_64-pc-windows-gnu | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
|
||
# Append the linker to the cargo config for windows cross compile | ||
RUN echo "[target.x86_64-pc-windows-gnu]" >> /usr/local/cargo/config && \ | ||
echo "linker = '/usr/bin/x86_64-w64-mingw32-gcc'" >> /usr/local/cargo/config | ||
|
||
ENV CC_x86_64_unknown_linux_musl="gcc" |