zola/Dockerfile
Martin Kühl 1bbca5c059
Use distroless instead of dockerize (#1643)
The distroless cc base image includes only what's required to run compiled rust binaries,
see [1] for more info about these images.
Using this base image lets us get rid of dockerize and its build steps and dependencies, including python.
On top of that it provides ca-certificates, timezone data, and other necessary infrastructure.

[1]: https://github.com/GoogleContainerTools/distroless

Fixes #1642
2021-10-21 19:37:12 +02:00

15 lines
364 B
Docker

FROM rust:slim AS builder
RUN apt-get update -y && \
apt-get install -y make g++ libssl-dev && \
rustup target add x86_64-unknown-linux-gnu
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-gnu
FROM gcr.io/distroless/cc
COPY --from=builder /app/target/x86_64-unknown-linux-gnu/release/zola /bin/zola
ENTRYPOINT [ "/bin/zola" ]