Browse Source

Fixed glibc/musl Incompatibility (Alpine → Debian)

pull/7178/head
chrislu 2 months ago
parent
commit
088347af35
  1. 37
      docker/Dockerfile.foundationdb_large

37
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

Loading…
Cancel
Save