Updated and tested Dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -1,18 +1,19 @@
|
|||||||
# See https://github.com/LukeMathWalker/cargo-chef
|
# See https://github.com/LukeMathWalker/cargo-chef
|
||||||
ARG RUST_VERSION=1-buster
|
ARG DEBIAN_RELEASE=bookworm
|
||||||
FROM rust:${RUST_VERSION} as planner
|
ARG RUST_VERSION=1-${DEBIAN_RELEASE}
|
||||||
|
FROM rust:${RUST_VERSION} AS planner
|
||||||
WORKDIR /scryer-prolog
|
WORKDIR /scryer-prolog
|
||||||
RUN cargo install cargo-chef
|
RUN cargo install cargo-chef
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
FROM rust:${RUST_VERSION} as cacher
|
FROM rust:${RUST_VERSION} AS cacher
|
||||||
WORKDIR /scryer-prolog
|
WORKDIR /scryer-prolog
|
||||||
RUN cargo install cargo-chef
|
RUN cargo install cargo-chef
|
||||||
COPY --from=planner /scryer-prolog/recipe.json recipe.json
|
COPY --from=planner /scryer-prolog/recipe.json recipe.json
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
FROM rust:${RUST_VERSION} as builder
|
FROM rust:${RUST_VERSION} AS builder
|
||||||
WORKDIR /scryer-prolog
|
WORKDIR /scryer-prolog
|
||||||
COPY . .
|
COPY . .
|
||||||
# Copy over the cached dependencies
|
# Copy over the cached dependencies
|
||||||
@@ -20,9 +21,11 @@ COPY --from=cacher /scryer-prolog/target target
|
|||||||
COPY --from=cacher $CARGO_HOME $CARGO_HOME
|
COPY --from=cacher $CARGO_HOME $CARGO_HOME
|
||||||
RUN cargo build --release --bin scryer-prolog
|
RUN cargo build --release --bin scryer-prolog
|
||||||
|
|
||||||
# Newer versions of Debian (i.e. bookworm) contain libssl3 instead of libssl1.1
|
FROM debian:${DEBIAN_RELEASE}-slim
|
||||||
# which we depend on.
|
RUN apt-get update \
|
||||||
FROM debian:bullseye-slim
|
&& apt-get install -y --no-install-recommends openssl \
|
||||||
|
&& apt-get clean -y \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=builder /scryer-prolog/target/release/scryer-prolog /usr/local/bin
|
COPY --from=builder /scryer-prolog/target/release/scryer-prolog /usr/local/bin
|
||||||
ENV RUST_BACKTRACE=1
|
ENV RUST_BACKTRACE=1
|
||||||
# Sanity check the binary: if it can't be executed (e.g. if there are missing libraries)
|
# Sanity check the binary: if it can't be executed (e.g. if there are missing libraries)
|
||||||
|
|||||||
Reference in New Issue
Block a user