6 changed files with 102 additions and 164 deletions
-
53docker/Dockerfile.foundationdb_large
-
2docker/filer_foundationdb.toml
-
54test/foundationdb/Dockerfile.build.arm64
-
113test/foundationdb/Dockerfile.fdb-arm64
-
28test/foundationdb/README.ARM64.md
-
16weed/filer/foundationdb/foundationdb_store_test.go
@ -1,80 +1,51 @@ |
|||
# Multi-stage Dockerfile to build FoundationDB for ARM64 |
|||
FROM --platform=linux/arm64 ubuntu:22.04 as builder |
|||
|
|||
# Install dependencies for building FoundationDB |
|||
RUN apt-get update && apt-get install -y \ |
|||
build-essential \ |
|||
cmake \ |
|||
git \ |
|||
python3 \ |
|||
python3-pip \ |
|||
wget \ |
|||
curl \ |
|||
ninja-build \ |
|||
libboost-dev \ |
|||
libboost-system-dev \ |
|||
libboost-filesystem-dev \ |
|||
libssl-dev \ |
|||
openjdk-8-jdk \ |
|||
mono-complete \ |
|||
&& rm -rf /var/lib/apt/lists/* |
|||
|
|||
# Clone FoundationDB source |
|||
WORKDIR /tmp |
|||
RUN git clone https://github.com/apple/foundationdb.git |
|||
WORKDIR /tmp/foundationdb |
|||
|
|||
# Checkout a stable release version (ARM64 build from source) |
|||
# Using 7.1 branch as 7.4.5 ARM64 builds are not available pre-built |
|||
RUN git checkout release-7.1 |
|||
|
|||
# Build FoundationDB (disable bindings that cause issues) |
|||
RUN mkdir build |
|||
WORKDIR /tmp/foundationdb/build |
|||
RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \ |
|||
-DBUILD_JAVA_BINDING=OFF \ |
|||
-DBUILD_CSHARP_BINDING=OFF \ |
|||
-DBUILD_PYTHON_BINDING=OFF \ |
|||
-DBUILD_RUBY_BINDING=OFF \ |
|||
.. |
|||
RUN ninja -j$(nproc) fdbserver fdbcli |
|||
|
|||
# Runtime stage |
|||
# FoundationDB server image for ARM64 using official prebuilt packages |
|||
FROM --platform=linux/arm64 ubuntu:22.04 |
|||
|
|||
# Install runtime dependencies |
|||
ARG FOUNDATIONDB_VERSION=7.4.5 |
|||
ENV FOUNDATIONDB_VERSION=${FOUNDATIONDB_VERSION} |
|||
|
|||
# Install prerequisites |
|||
RUN apt-get update && apt-get install -y \ |
|||
ca-certificates \ |
|||
wget \ |
|||
python3 \ |
|||
libssl3 \ |
|||
libboost-system1.74.0 \ |
|||
libboost-filesystem1.74.0 \ |
|||
&& rm -rf /var/lib/apt/lists/* |
|||
|
|||
# Copy built binaries from builder stage |
|||
COPY --from=builder /tmp/foundationdb/build/bin/fdbserver /usr/bin/ |
|||
COPY --from=builder /tmp/foundationdb/build/bin/fdbcli /usr/bin/ |
|||
COPY --from=builder /tmp/foundationdb/build/lib/libfdb_c.so /usr/lib/ |
|||
|
|||
# Create FDB directories |
|||
RUN mkdir -p /var/fdb/{logs,data,config} && \ |
|||
mkdir -p /usr/lib/foundationdb && \ |
|||
mkdir -p /var/fdb/scripts |
|||
|
|||
# Create basic startup script |
|||
COPY --from=builder /tmp/foundationdb/packaging/docker/scripts/* /var/fdb/scripts/ |
|||
RUN chmod +x /var/fdb/scripts/* |
|||
|
|||
# Set environment variables |
|||
# NOTE: These defaults are for single-node testing only. |
|||
# For multi-node Docker Compose clusters, override PUBLIC_IP with the container's |
|||
# network-resolvable hostname/IP via docker-compose environment settings. |
|||
ENV FDB_NETWORKING_MODE=container |
|||
ENV FDB_COORDINATOR_PORT=4500 |
|||
ENV FDB_PORT=4501 |
|||
ENV PUBLIC_IP=auto |
|||
|
|||
# Expose ports |
|||
EXPOSE 4500 4501 |
|||
|
|||
# Default command |
|||
CMD ["/var/fdb/scripts/fdb.bash"] |
|||
# Install FoundationDB server + client debs with checksum verification |
|||
RUN set -euo pipefail && \ |
|||
apt-get update && \ |
|||
case "${FOUNDATIONDB_VERSION}" in \ |
|||
"7.4.5") \ |
|||
CLIENT_SHA="f2176b86b7e1b561c3632b4e6e7efb82e3b8f57c2ff0d0ac4671e742867508aa"; \ |
|||
SERVER_SHA="d7b081afbbabfdf2452cfbdc5c7c895165457ae32d91fc7f9489da921ab02e26"; \ |
|||
;; \ |
|||
*) \ |
|||
echo "Unsupported FoundationDB version ${FOUNDATIONDB_VERSION} for ARM64 runtime" >&2; \ |
|||
exit 1 ;; \ |
|||
esac && \ |
|||
for component in clients server; do \ |
|||
if [ "${component}" = "clients" ]; then \ |
|||
EXPECTED_SHA="${CLIENT_SHA}"; \ |
|||
else \ |
|||
EXPECTED_SHA="${SERVER_SHA}"; \ |
|||
fi && \ |
|||
PACKAGE="foundationdb-${component}_${FOUNDATIONDB_VERSION}-1_aarch64.deb" && \ |
|||
PACKAGE_PATH="/tmp/${PACKAGE}" && \ |
|||
wget --timeout=30 --tries=3 -O "${PACKAGE_PATH}" \ |
|||
"https://github.com/apple/foundationdb/releases/download/${FOUNDATIONDB_VERSION}/${PACKAGE}" && \ |
|||
echo "${EXPECTED_SHA} ${PACKAGE_PATH}" | sha256sum -c - && \ |
|||
apt-get install -y "${PACKAGE_PATH}" && \ |
|||
rm "${PACKAGE_PATH}"; \ |
|||
done && \ |
|||
rm -rf /var/lib/apt/lists/* && \ |
|||
ldconfig && \ |
|||
echo "✅ Installed FoundationDB ${FOUNDATIONDB_VERSION} (server + clients)" |
|||
|
|||
# Prepare directories commonly bind-mounted by docker-compose |
|||
RUN mkdir -p /var/fdb/{logs,data,config} /usr/lib/foundationdb |
|||
|
|||
# Provide a simple default command (docker-compose overrides this) |
|||
CMD ["/bin/bash"] |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue