added windows build docker

This commit is contained in:
2023-04-08 22:53:42 -03:00
parent 4fe28faeeb
commit 22bbe4117d
6 changed files with 31 additions and 41 deletions

13
build/build.sh Normal file
View File

@@ -0,0 +1,13 @@
if [ "$1" = "macos-arm" ]; then
rustup target add aarch64-apple-darwin
cargo build --release --target=aarch64-apple-darwin
elif [ "$1" = "linux" ]; then
cd /usr/src
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target=x86_64-unknown-linux-gnu
elif [ "$1" = "windows" ]; then
cd /usr/src
rustup target add x86_64-pc-windows-gnu
rustup toolchain install stable-x86_64-pc-windows-gnu
cargo build --release --target=x86_64-pc-windows-gnu
fi

View File

@@ -0,0 +1,8 @@
FROM rust:latest
RUN apt update && apt upgrade -y
RUN apt install -y g++-mingw-w64-x86-64
WORKDIR /usr/src
CMD ["sh", "./build/build.sh", "windows"]

View File

@@ -0,0 +1,9 @@
version: "2.9"
services:
app:
build:
dockerfile: ./windows_build.Dockerfile
volumes:
- ../:/usr/src
- /usr/src/Project