mirror of
https://github.com/DefectingCat/rua-list
synced 2025-07-15 00:31:31 +00:00
Add docker build file
This commit is contained in:
@ -1,2 +1,5 @@
|
||||
target/
|
||||
.git/
|
||||
.git/
|
||||
config.json
|
||||
logs/
|
||||
.DS_Store
|
31
dockerfiles/Dockerfile.windows
Normal file
31
dockerfiles/Dockerfile.windows
Normal file
@ -0,0 +1,31 @@
|
||||
FROM rust:1.67-alpine as builder
|
||||
RUN apk add --no-cache musl-dev sqlite-static openssl-dev openssl-libs-static pkgconf libpq-dev mingw-w64-gcc
|
||||
|
||||
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 \
|
||||
&& 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 \
|
||||
&& update-ca-certificates
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT [ "/bin/bash" ]
|
Reference in New Issue
Block a user