|
1 | 1 | # See https://github.com/LukeMathWalker/cargo-chef
|
2 |
| -ARG RUST_VERSION=1-buster |
3 |
| -FROM rust:${RUST_VERSION} as planner |
| 2 | +ARG DEBIAN_RELEASE=bookworm |
| 3 | +ARG RUST_VERSION=1-${DEBIAN_RELEASE} |
| 4 | +FROM rust:${RUST_VERSION} AS planner |
4 | 5 | WORKDIR /scryer-prolog
|
5 | 6 | RUN cargo install cargo-chef
|
6 | 7 | COPY . .
|
7 | 8 | RUN cargo chef prepare --recipe-path recipe.json
|
8 | 9 |
|
9 |
| -FROM rust:${RUST_VERSION} as cacher |
| 10 | +FROM rust:${RUST_VERSION} AS cacher |
10 | 11 | WORKDIR /scryer-prolog
|
11 | 12 | RUN cargo install cargo-chef
|
12 | 13 | COPY --from=planner /scryer-prolog/recipe.json recipe.json
|
13 | 14 | RUN cargo chef cook --release --recipe-path recipe.json
|
14 | 15 |
|
15 |
| -FROM rust:${RUST_VERSION} as builder |
| 16 | +FROM rust:${RUST_VERSION} AS builder |
16 | 17 | WORKDIR /scryer-prolog
|
17 | 18 | COPY . .
|
18 | 19 | # Copy over the cached dependencies
|
19 | 20 | COPY --from=cacher /scryer-prolog/target target
|
20 | 21 | COPY --from=cacher $CARGO_HOME $CARGO_HOME
|
21 | 22 | RUN cargo build --release --bin scryer-prolog
|
22 | 23 |
|
23 |
| -# Newer versions of Debian (i.e. bookworm) contain libssl3 instead of libssl1.1 |
24 |
| -# which we depend on. |
25 |
| -FROM debian:bullseye-slim |
| 24 | +FROM debian:${DEBIAN_RELEASE}-slim |
| 25 | +RUN apt-get update \ |
| 26 | + && apt-get install -y --no-install-recommends openssl \ |
| 27 | + && apt-get clean -y \ |
| 28 | + && rm -rf /var/lib/apt/lists/* |
26 | 29 | COPY --from=builder /scryer-prolog/target/release/scryer-prolog /usr/local/bin
|
27 | 30 | ENV RUST_BACKTRACE=1
|
28 | 31 | # Sanity check the binary: if it can't be executed (e.g. if there are missing libraries)
|
|
0 commit comments