Files
rua-list/dockerfiles/Dockerfile.windows
2023-05-11 09:10:48 +08:00

29 lines
864 B
Docker

FROM rust:latest as builder
WORKDIR /app
# Create appuser
ENV USER=xfy
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}" \
&& mkdir $HOME/.cargo \
&& echo "[source.crates-io]" >> $HOME/.cargo/config \
&& echo "replace-with = 'ustc'" >> $HOME/.cargo/config \
&& echo "" >> $HOME/.cargo/config \
&& echo "[source.ustc]" >> $HOME/.cargo/config \
&& echo "registry = \"sparse+https://mirrors.ustc.edu.cn/crates.io-index/\"" >> $HOME/.cargo/config \
&& apt update \
&& apt install -y g++-mingw-w64-x86-64 \
&& rustup target add x86_64-unknown-linux-musl \
&& rustup target add x86_64-pc-windows-gnu \
&& rustup toolchain install stable-x86_64-pc-windows-gnu
ENTRYPOINT [ "/bin/bash" ]