Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.2 KiB
25 lines
1.2 KiB
FROM --platform=$BUILDPLATFORM rust:1-bookworm as builder
|
|
ARG BUILDARCH TARGETARCH
|
|
RUN apt-get update && \
|
|
apt-get install -y libclang-dev clang && \
|
|
if [ "$BUILDARCH" != "$TARGETARCH" ] && [ "$TARGETARCH" = "arm64" ] ; \
|
|
then \
|
|
apt-get install -y g++-aarch64-linux-gnu && \
|
|
rustup target add aarch64-unknown-linux-gnu ; \
|
|
fi
|
|
COPY . /oxigraph
|
|
WORKDIR /oxigraph/cli
|
|
RUN if [ "$BUILDARCH" != "$TARGETARCH" ] && [ "$TARGETARCH" = "arm64" ] ; \
|
|
then \
|
|
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc && \
|
|
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot /usr/aarch64-linux-gnu" && \
|
|
cargo build --release --target aarch64-unknown-linux-gnu --no-default-features --features rustls-webpki && \
|
|
mv /oxigraph/target/aarch64-unknown-linux-gnu/release/oxigraph /oxigraph/target/release/oxigraph ; \
|
|
else \
|
|
cargo build --release --no-default-features --features rustls-webpki ; \
|
|
fi
|
|
|
|
FROM --platform=$TARGETPLATFORM gcr.io/distroless/cc-debian12
|
|
COPY --from=builder /oxigraph/target/release/oxigraph /usr/local/bin/oxigraph
|
|
ENTRYPOINT [ "/usr/local/bin/oxigraph" ]
|
|
CMD [ "serve", "--location", "/data", "--bind", "0.0.0.0:7878" ]
|
|
|