From 0948f75248a5daf8229ce1f40d1b3ec8d9aecbac Mon Sep 17 00:00:00 2001 From: fx Date: Sun, 15 Oct 2023 02:26:29 +0200 Subject: test w/ cargo chef + arm64 --- Dockerfile | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index d014c5a..5757f0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,26 @@ -FROM --platform=amd64 debian:bullseye-slim +FROM debian:bookworm AS deb_extractor +RUN cd /tmp && \ + apt-get update && apt-get download \ + libc6 && \ + mkdir /dpkg && \ + for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done -WORKDIR /usr/local/webol -COPY target/armv7-unknown-linux-gnueabihf/release/webol /usr/local/bin/webol +FROM lukemathwalker/cargo-chef:latest-rust-1.73.0 as chef +WORKDIR app + +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef as builder +COPY --from=planner /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path recipe.json +COPY . . +RUN cargo build --release + +FROM gcr.io/distroless/cc +COPY --from=builder /app/target/release/webol / +COPY --from=deb_extractor /dpkg / EXPOSE 7229 -CMD ["webol"] \ No newline at end of file +ENTRYPOINT ["./webol"] -- cgit v1.2.3