Skip to content

Instantly share code, notes, and snippets.

@fusetim
Created January 20, 2021 17:20
Show Gist options
  • Save fusetim/de5a9a17503e7c0d6a4e754db350abf4 to your computer and use it in GitHub Desktop.
Save fusetim/de5a9a17503e7c0d6a4e754db350abf4 to your computer and use it in GitHub Desktop.
Dockerfile for Zola (https://getzola.org)
FROM rust:slim AS builder
RUN apt-get update -y && \
apt-get install -y python-pip make g++ python-setuptools libssl-dev pkg-config rsync && \
pip install dockerize && \
rustup target add x86_64-unknown-linux-gnu
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-gnu
RUN mv target/x86_64-unknown-linux-gnu/release/zola /usr/bin
RUN mkdir -p /workdir
WORKDIR /workdir
RUN dockerize -n -o /workdir /usr/bin/zola
FROM scratch
COPY --from=builder /workdir .
ENTRYPOINT [ "/usr/bin/zola" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment