Compare commits
2 commits
cec24f1cc7
...
1e116ad19a
Author | SHA1 | Date | |
---|---|---|---|
1e116ad19a | |||
57ada7307f |
1 changed files with 9 additions and 10 deletions
19
Dockerfile
19
Dockerfile
|
@ -1,27 +1,26 @@
|
||||||
FROM rust:slim-bookworm AS builder
|
FROM rust:slim-bookworm AS builder
|
||||||
|
|
||||||
ARG USE_GH_RELEASE=false
|
ARG USE_GH_RELEASE=true
|
||||||
ARG ZOLA_RELEASE_VERSION=latest
|
ARG ZOLA_RELEASE_VERSION=latest
|
||||||
RUN apt-get update -y && \
|
RUN apt-get update -y && \
|
||||||
apt-get install -y pkg-config make g++ libssl-dev curl jq tar gzip
|
apt-get install -y pkg-config make g++ libssl-dev curl jq tar gzip
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN if [ "${USE_GH_RELEASE}" = "true" ]; then \
|
RUN if [ "${USE_GH_RELEASE}" = "true" ]; then \
|
||||||
if [ "${ZOLA_RELEASE_VERSION}" = "latest" ]; 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; \
|
||||||
export ZOLA_VERSION=$(curl -sL https://api.github.com/repos/getzola/zola/releases/latest | jq -r .name); \
|
|
||||||
else \
|
|
||||||
export ZOLA_VERSION="${ZOLA_RELEASE_VERSION}"; \
|
|
||||||
fi && \
|
|
||||||
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; \
|
tar -xzvf zola.tar.gz zola; \
|
||||||
else \
|
else \
|
||||||
cargo build --release && \
|
cargo build --release && \
|
||||||
cp target/$(uname -m)-unknown-linux-gnu/release/zola zola; \
|
cp target/$(uname -m)-unknown-linux-gnu/release/zola zola; \
|
||||||
fi && ./zola --version
|
fi
|
||||||
|
|
||||||
|
RUN ./zola --version
|
||||||
|
|
||||||
FROM gcr.io/distroless/cc-debian12
|
FROM gcr.io/distroless/cc-debian12
|
||||||
COPY --from=builder /app/zola /bin/zola
|
COPY --from=builder /app/zola /bin/zola
|
||||||
|
RUN apt-get update -y && \
|
||||||
|
apt-get install rsync
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "-l", "-c"]
|
ENTRYPOINT ["/bin/bash", "-l", "-c"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue