2023-12-05 11:52:09 +00:00
|
|
|
#
|
|
|
|
# Dockerfile that builds a SurrealDB docker image.
|
|
|
|
#
|
|
|
|
|
|
|
|
FROM cgr.dev/chainguard/rust:latest-dev as builder
|
|
|
|
|
|
|
|
USER root
|
|
|
|
RUN apk update
|
|
|
|
RUN apk add patch clang curl gcc cmake
|
|
|
|
|
|
|
|
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc
|
|
|
|
|
|
|
|
RUN mkdir /surrealdb
|
|
|
|
WORKDIR /surrealdb
|
|
|
|
COPY . /surrealdb/
|
|
|
|
|
2023-12-15 21:53:25 +00:00
|
|
|
RUN cargo build --features storage-tikv --release --locked
|
2023-12-05 11:52:09 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Development image
|
|
|
|
#
|
|
|
|
FROM cgr.dev/chainguard/glibc-dynamic:latest-dev as dev
|
|
|
|
|
|
|
|
USER root
|
|
|
|
COPY --from=builder /surrealdb/target/release/surreal /surreal
|
|
|
|
|
|
|
|
ENTRYPOINT ["/surreal"]
|
|
|
|
|
|
|
|
#
|
|
|
|
# Production image
|
|
|
|
#
|
|
|
|
FROM cgr.dev/chainguard/glibc-dynamic:latest as prod
|
|
|
|
|
|
|
|
COPY --from=builder /surrealdb/target/release/surreal /surreal
|
|
|
|
|
|
|
|
ENTRYPOINT ["/surreal"]
|