single multiplatform build for shadowsockets-rust
Some checks failed
CI / Build shadowsocks-rust docker images (push) Has been cancelled

This commit is contained in:
2024-06-25 09:04:29 +08:00
parent a4d566fb29
commit 62921644ae
2 changed files with 14 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM rust:alpine3.20 AS builder
FROM --platform=$TARGETPLATFORM rust:alpine AS builder
ARG TARGETARCH VERSION
ARG VERSION TARGETPLATFORM
RUN set -x \
&& apk add --no-cache build-base cmake llvm15-dev clang15-libclang clang15 rust-bindgen git
@@ -9,7 +9,7 @@ WORKDIR /root/shadowsocks-rust
RUN git clone --depth 1 --branch "v${VERSION}" https://github.com/shadowsocks/shadowsocks-rust.git .
RUN case "$TARGETARCH" in \
RUN case "$TARGETPLATFORM" in \
"386") \
RUST_TARGET="i686-unknown-linux-musl" \
MUSL="i686-linux-musl" \
@@ -22,8 +22,12 @@ RUN case "$TARGETARCH" in \
RUST_TARGET="aarch64-unknown-linux-musl" \
MUSL="aarch64-linux-musl" \
;; \
"linux/arm/v7") \
RUST_TARGET="arm-unknown-linux-musleabihf" \
MUSL="arm-linux-musleabihf" \
;; \
*) \
echo "Doesn't support $TARGETARCH architecture" \
echo "Doesn't support $TARGETPLATFORM architecture" \
exit 1 \
;; \
esac \