zola/Dockerfile

29 lines
946 B
Docker
Raw Permalink Normal View History

FROM lukemathwalker/cargo-chef:latest-rust-slim AS chef
WORKDIR zola
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
FROM deps AS recipe
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
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
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
LABEL org.opencontainers.image.authors="Emelie Graven <emelie@graven.dev>"
2019-05-30 20:58:52 +00:00