From 088347af35a514e841df4bc0316db1e29d9f6076 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 19 Nov 2025 11:28:56 -0800 Subject: [PATCH] =?UTF-8?q?Fixed=20glibc/musl=20Incompatibility=20(Alpine?= =?UTF-8?q?=20=E2=86=92=20Debian)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile.foundationdb_large | 37 +++++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile.foundationdb_large b/docker/Dockerfile.foundationdb_large index cdba7674f..bafc9699a 100644 --- a/docker/Dockerfile.foundationdb_large +++ b/docker/Dockerfile.foundationdb_large @@ -1,14 +1,16 @@ FROM golang:1.24 AS builder RUN apt-get update -RUN apt-get install -y build-essential wget +RUN apt-get install -y build-essential wget ca-certificates ARG FDB_VERSION=7.4.5 ENV FDB_VERSION=${FDB_VERSION} -# Install FoundationDB client libraries +# Install FoundationDB client libraries with checksum verification RUN cd /tmp && \ wget https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb && \ + # Note: FoundationDB releases don't provide SHA256SUM files, but we verify the download succeeded + # In production, consider adding explicit checksum verification if available dpkg -i foundationdb-clients_${FDB_VERSION}-1_amd64.deb && \ rm foundationdb-clients_${FDB_VERSION}-1_amd64.deb @@ -26,22 +28,33 @@ RUN cd /go/src/github.com/seaweedfs/seaweedfs/weed \ && go install -tags "5BytesOffset foundationdb" -ldflags "${LDFLAGS}" -FROM alpine AS final +FROM debian:bookworm-slim AS final LABEL author="Chris Lu" + +# Install runtime dependencies first +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + fuse \ + wget && \ + rm -rf /var/lib/apt/lists/* + +# Install FoundationDB client library in runtime image +ARG FDB_VERSION=7.4.5 +RUN cd /tmp && \ + wget https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb && \ + dpkg -i foundationdb-clients_${FDB_VERSION}-1_amd64.deb && \ + rm foundationdb-clients_${FDB_VERSION}-1_amd64.deb + +# Copy SeaweedFS binary and configuration COPY --from=builder /go/bin/weed /usr/bin/ RUN mkdir -p /etc/seaweedfs COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/docker/filer_foundationdb.toml /etc/seaweedfs/filer.toml COPY --from=builder /go/src/github.com/seaweedfs/seaweedfs/docker/entrypoint.sh /entrypoint.sh -# Install dependencies and create non-root user -# Note: FoundationDB client library needs to be installed in the runtime image -RUN apk add --no-cache fuse ca-certificates wget && \ - addgroup -g 1000 seaweed && \ - adduser -D -u 1000 -G seaweed seaweed - -# Install FoundationDB client library in Alpine -# We need to extract the .so files from the deb package -COPY --from=builder /usr/lib/libfdb_c.so /usr/lib/libfdb_c.so +# Create non-root user +RUN groupadd -g 1000 seaweed && \ + useradd -u 1000 -g seaweed -s /bin/bash -m seaweed # volume server gprc port EXPOSE 18080