2021-11-16 15:03:41 +00:00
|
|
|
FROM lukemathwalker/cargo-chef:latest-rust-slim AS chef
|
|
|
|
WORKDIR zola
|
2020-02-03 01:42:43 +00:00
|
|
|
|
2021-11-16 15:03:41 +00:00
|
|
|
FROM chef AS deps
|
|
|
|
#RUN rustup target add x86_64-unknown-linux-musl
|
|
|
|
RUN apt-get update && apt-get install -y make g++ pkg-config libssl-dev # musl-tools
|
2020-02-03 01:42:43 +00:00
|
|
|
|
2021-11-16 15:03:41 +00:00
|
|
|
FROM deps AS recipe
|
2020-02-03 01:42:43 +00:00
|
|
|
COPY . .
|
2021-11-16 15:03:41 +00:00
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
2020-02-03 01:42:43 +00:00
|
|
|
|
2021-11-16 15:03:41 +00:00
|
|
|
FROM deps AS build
|
|
|
|
COPY --from=recipe /zola/recipe.json recipe.json
|
|
|
|
#RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
2020-02-03 01:42:43 +00:00
|
|
|
|
2021-11-16 15:03:41 +00:00
|
|
|
COPY . .
|
|
|
|
#RUN cargo build --release --target x86_64-unknown-linux-musl --bin zola
|
|
|
|
RUN cargo build --release --bin zola
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim AS runtime
|
|
|
|
WORKDIR zola
|
|
|
|
#COPY --from=build zola/target/x86_64-unknown-linux-musl/release/zola /usr/local/bin/
|
|
|
|
COPY --from=build zola/target/release/zola /usr/local/bin/
|
|
|
|
ENTRYPOINT ["/usr/local/bin/zola"]
|
2019-05-30 20:58:52 +00:00
|
|
|
|
2021-11-16 15:03:41 +00:00
|
|
|
LABEL org.opencontainers.image.authors="Emelie Graven <emelie@graven.dev>"
|
2019-05-30 20:58:52 +00:00
|
|
|
|