chore: refactor Docker image building (#2005)

This commit is contained in:
zonescape
2025-08-16 21:39:11 +03:00
committed by GitHub
parent 2e99114a53
commit 62ee719aaf

View File

@@ -1,9 +1,9 @@
FROM --platform=$BUILDPLATFORM rust:alpine3.20 AS builder
FROM --platform=$BUILDPLATFORM rust:1.89.0-alpine3.22 AS builder
ARG TARGETARCH
RUN set -x \
&& apk add --no-cache build-base cmake llvm15-dev clang15-libclang clang15 rust-bindgen
&& apk add --no-cache musl-dev
WORKDIR /root/shadowsocks-rust
@@ -36,7 +36,6 @@ RUN case "$TARGETARCH" in \
&& PATH="/root/$MUSL-cross/bin:$PATH" \
&& CC=/root/$MUSL-cross/bin/$MUSL-gcc \
&& echo "CC=$CC" \
&& rustup override set stable \
&& rustup target add "$RUST_TARGET" \
&& RUSTFLAGS="-C linker=$CC" CC=$CC cargo build --target "$RUST_TARGET" --release --features "full" \
&& mv target/$RUST_TARGET/release/ss* target/release/