zola-ci/Dockerfile
brooke 96244a6a74
All checks were successful
Build And Publish Docker / build-latest (push) Successful in 3m55s
update
2025-04-13 16:44:41 -04:00

25 lines
733 B
Docker

FROM rust:slim-bookworm AS builder
ARG USE_GH_RELEASE=true
ARG ZOLA_VERSION
RUN apt-get update -y && \
apt-get install -y pkg-config make g++ libssl-dev curl jq tar gzip
WORKDIR /app
COPY . .
RUN if [ "${USE_GH_RELEASE}" = "true" ]; then \
curl -sL --fail --output zola.tar.gz https://github.com/getzola/zola/releases/download/${ZOLA_VERSION}/zola-${ZOLA_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz; \
tar -xzvf zola.tar.gz zola; \
else \
cargo build --release && \
cp target/$(uname -m)-unknown-linux-gnu/release/zola zola; \
fi
RUN ./zola --version
FROM docker.io/alpine:3.2
COPY --from=builder /app/zola /bin/zola
RUN apk update && apk add --no-cache rsync
ENTRYPOINT ["/bin/bash", "-l", "-c"]