mirror of
https://github.com/getzola/zola
synced 2024-12-12 13:22:29 +00:00
1bbca5c059
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
15 lines
364 B
Docker
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" ]
|