docker: use alpine packages for Rust builder to fix linux/386 builds (#8837)
The upstream rust:alpine manifest list no longer includes linux/386, breaking multi-platform builds. Switch the Rust volume server builder stage to alpine:3.23 and install Rust toolchain via apk instead. Also adds openssl-dev which is needed for the build.
This commit is contained in:
@@ -16,15 +16,16 @@ RUN cd /go/src/github.com/seaweedfs/seaweedfs/weed \
|
|||||||
&& export LDFLAGS="-X github.com/seaweedfs/seaweedfs/weed/util/version.COMMIT=$(git rev-parse --short HEAD)" \
|
&& export LDFLAGS="-X github.com/seaweedfs/seaweedfs/weed/util/version.COMMIT=$(git rev-parse --short HEAD)" \
|
||||||
&& CGO_ENABLED=0 go install -tags "$TAGS" -ldflags "-extldflags -static ${LDFLAGS}"
|
&& CGO_ENABLED=0 go install -tags "$TAGS" -ldflags "-extldflags -static ${LDFLAGS}"
|
||||||
|
|
||||||
# Rust volume server builder (amd64/arm64 only)
|
# Rust volume server builder. Alpine packages avoid depending on the
|
||||||
FROM rust:1-alpine as rust_builder
|
# upstream rust:alpine manifest list, which no longer includes linux/386.
|
||||||
|
FROM alpine:3.23 as rust_builder
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
RUN apk add musl-dev protobuf-dev git
|
|
||||||
COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/seaweed-volume /build/seaweed-volume
|
COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/seaweed-volume /build/seaweed-volume
|
||||||
COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/proto /build/proto
|
COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/proto /build/proto
|
||||||
WORKDIR /build/seaweed-volume
|
WORKDIR /build/seaweed-volume
|
||||||
ARG TAGS
|
ARG TAGS
|
||||||
RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
|
RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
|
apk add --no-cache musl-dev openssl-dev protobuf-dev git rust cargo; \
|
||||||
if [ "$TAGS" = "5BytesOffset" ]; then \
|
if [ "$TAGS" = "5BytesOffset" ]; then \
|
||||||
cargo build --release; \
|
cargo build --release; \
|
||||||
else \
|
else \
|
||||||
|
|||||||
Reference in New Issue
Block a user