surrealpatch/docker/Dockerfile.fdb

40 lines
1.1 KiB
Text
Raw Normal View History

#
# Dockerfile that builds a SurrealDB docker image with FoundationDB support.
#
FROM --platform=linux/amd64 cgr.dev/chainguard/rust:latest-dev as builder
USER root
RUN apk update
RUN apk add patch clang curl cmake
RUN mkdir /surrealdb
WORKDIR /surrealdb
COPY . /surrealdb/
RUN curl -L https://github.com/apple/foundationdb/releases/download/7.1.42/libfdb_c.x86_64.so -o libfdb_c.so && \
echo "9501a7910fe2d47b805c48c467fddaf485ccf4b1195863e3c5fb0c86648084f1 libfdb_c.so" | sha256sum -c -s - || exit 1 && \
mv libfdb_c.so /usr/lib/ && \
cargo build --features storage-tikv,storage-fdb --release --locked
#
# Development image
#
FROM cgr.dev/chainguard/glibc-dynamic:latest-dev as dev
USER root
COPY --from=builder /surrealdb/target/release/surreal /surreal
COPY --from=builder /usr/lib/libfdb_c.so /usr/lib/libfdb_c.so
ENTRYPOINT ["/surreal"]
#
# Production image
#
FROM cgr.dev/chainguard/glibc-dynamic:latest as prod
COPY --from=builder /surrealdb/target/release/surreal /surreal
COPY --from=builder /usr/lib/libfdb_c.so /usr/lib/libfdb_c.so
ENTRYPOINT ["/surreal"]