From 6ce418c18f6678f9dc01a5a3d867354dae612371 Mon Sep 17 00:00:00 2001 From: Walter Oggioni Date: Sun, 7 Jul 2024 20:58:58 +0800 Subject: [PATCH] fixed shadowsocks-rust build --- .gitea/workflows/build-shadowsocks-rust.yaml | 8 ++++---- shadowsocks-rust/Dockerfile | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build-shadowsocks-rust.yaml b/.gitea/workflows/build-shadowsocks-rust.yaml index 8662fec..85b3dad 100644 --- a/.gitea/workflows/build-shadowsocks-rust.yaml +++ b/.gitea/workflows/build-shadowsocks-rust.yaml @@ -9,14 +9,14 @@ jobs: "Build shadowsocks-rust docker images": runs-on: woryzen steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v3.4.0 with: driver: docker-container + platforms: | + linux/amd64 + linux/arm64 - name: Login to Gitea container registry uses: docker/login-action@v3 diff --git a/shadowsocks-rust/Dockerfile b/shadowsocks-rust/Dockerfile index fe8c14e..7308272 100644 --- a/shadowsocks-rust/Dockerfile +++ b/shadowsocks-rust/Dockerfile @@ -1,6 +1,6 @@ -FROM --platform=$TARGETPLATFORM rust:alpine AS builder +FROM --platform=$BUILDPLATFORM rust:alpine AS builder -ARG VERSION TARGETPLATFORM +ARG VERSION TARGETPLATFORM BUILDPLATFORM RUN set -x \ && apk add --no-cache build-base cmake llvm15-dev clang15-libclang clang15 rust-bindgen git rustup @@ -40,7 +40,7 @@ RUN case "$TARGETPLATFORM" in \ && RUSTFLAGS="-C linker=$CC" CC=$CC cargo build --target "$RUST_TARGET" --release --features "full-extra" \ && mv target/$RUST_TARGET/release/ss* target/release/ -FROM alpine:3.20 AS sslocal +FROM --platform=$TARGETPLATFORM alpine:3.20 AS sslocal # NOTE: Please be careful to change the path of these binaries, refer to #1149 for more information. COPY --from=builder /root/shadowsocks-rust/target/release/sslocal /usr/bin/