parent
8c68cf4041
commit
03f7641355
@ -1,11 +1,25 @@ |
||||
FROM rust:1-bullseye as builder |
||||
FROM --platform=$BUILDPLATFORM rust:1-bullseye as builder |
||||
ARG BUILDARCH TARGETARCH |
||||
RUN apt-get update && \ |
||||
apt-get install -y libclang-dev clang |
||||
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/server |
||||
RUN cargo build --release |
||||
WORKDIR /oxigraph/server |
||||
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 && \ |
||||
mv /oxigraph/target/aarch64-unknown-linux-gnu/release/oxigraph_server /oxigraph/target/release/oxigraph_server ; \ |
||||
else \ |
||||
cargo build --release ; \ |
||||
fi |
||||
|
||||
FROM gcr.io/distroless/cc-debian11 |
||||
FROM --platform=$TARGETPLATFORM gcr.io/distroless/cc-debian11 |
||||
COPY --from=builder /oxigraph/target/release/oxigraph_server /usr/local/bin/oxigraph_server |
||||
ENTRYPOINT [ "/usr/local/bin/oxigraph_server" ] |
||||
CMD [ "serve", "--location", "/data", "--bind", "0.0.0.0:7878" ] |
||||
|
Loading…
Reference in new issue