lychee/Dockerfile-CI.Dockerfile
Trask Stalnaker 76dbd843f4
Fix nightly docker image (#1590)
* Fix nightly docker image

* fix path to release binary

* Update Dockerfile to support both latest and nightly

Also supports dedicated release names like `lychee-v0.17.0` now.

It can be built locally with

```
docker build --build-arg LYCHEE_VERSION=latest -f Dockerfile-CI.Dockerfile .
```

---------

Co-authored-by: Matthias <matthias@endler.dev>
2024-12-18 09:21:50 +01:00

41 lines
1.5 KiB
Docker

FROM debian:bookworm-slim AS builder
WORKDIR /builder
ARG LYCHEE_VERSION="latest"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
jq \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& ARCH=$(case $(dpkg --print-architecture) in \
"amd64") echo "x86_64";; \
"arm64") echo "aarch64";; \
*) echo "Unsupported architecture" && exit 1;; \
esac) \
&& BASE_URL=$(case $LYCHEE_VERSION in \
"latest") echo "https://github.com/lycheeverse/lychee/releases/latest/download";; \
*) echo "https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION";; \
esac) \
&& wget -q -O - "$BASE_URL/lychee-$ARCH-unknown-linux-gnu.tar.gz" | tar -xz lychee \
&& chmod +x lychee
FROM debian:bookworm-slim
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
ca-certificates \
tzdata \
&& rm -rf /var/cache/debconf/* \
# Clean and keep the image small. This should not
# be necessary as the debian-slim images have an
# auto clean mechanism but we may rely on other
# images in the future (see:
# https://github.com/debuerreotype/debuerreotype/blob/master/scripts/debuerreotype-minimizing-config).
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /builder/lychee /usr/local/bin/lychee
ENTRYPOINT [ "/usr/local/bin/lychee" ]