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

View File

@@ -1,31 +0,0 @@
# FROM alpine:latest
# RUN apk update
# RUN apk upgrade
# RUN apk add curl file git
# RUN apk add gcc
# RUN apk add rust-doc
# # RUN apk search rust-std
# # RUN apk add rust-std
# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -y | sh
# # RUN source $HOME/.cargo/env
# CMD [""]
FROM rust:latest
RUN apt upgrade
RUN apt update
# RUN apt install -y \
# clang \
# gcc \
# g++ \
# zlib1g-dev \
# libmpc-dev \
# libmpfr-dev \
# libgmp-dev
CMD [""]

View File

@@ -1,10 +0,0 @@
if [ "$1" = "macos-arm" ]; then
rustup target add aarch64-apple-darwin
cargo build --release --target=aarch64-apple-darwin
elif [ "$1" = "linux" ]; then
rustup target add x86_64-unknown-linux-musl
cargo build --release --target=x86_64-unknown-linux-musl
elif [ "$1" = "windows" ]; then
rustup target add x86_64-pc-windows-msvc
cargo build --release --target=x86_64-pc-windows-msvc
fi

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

View File

@@ -45,6 +45,7 @@ fn main() {
project_type = args.project_type.as_ref().unwrap().to_string();
} else {
let selection = Select::with_theme(&ColorfulTheme::default())
.with_prompt("What type is your project?")
.items(&items)
.default(0)
.interact_on_opt(&Term::stderr());