zola/Dockerfile
Emelie Graven 5a95ec4586
All checks were successful
continuous-integration/drone/push Build is passing
Update docker image, add drone pipeline
2021-11-16 16:03:41 +01:00

29 lines
946 B
Docker

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"]
LABEL org.opencontainers.image.authors="Emelie Graven <emelie@graven.dev>"