Skip to content

Commit

Permalink
Update Dockerfile to support both latest and nightly
Browse files Browse the repository at this point in the history
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 .
```
  • Loading branch information
mre committed Dec 18, 2024
1 parent b45f78c commit 01c38aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
28 changes: 15 additions & 13 deletions Dockerfile-CI.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ WORKDIR /builder
ARG LYCHEE_VERSION="latest"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
ca-certificates \
jq \
wget \
&& case $(dpkg --print-architecture) in \
"amd64") \
wget -q -O - https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION/lychee-x86_64-unknown-linux-gnu.tar.gz | tar -xz lychee \
;; \
"arm64") \
wget -q -O - https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION/lychee-aarch64-unknown-linux-gnu.tar.gz | tar -xz lychee \
;; \
esac \
&& 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
Expand Down
21 changes: 11 additions & 10 deletions Dockerfile-CI.alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ WORKDIR /builder

ARG LYCHEE_VERSION="latest"

RUN apk update \
&& apk add --no-cache ca-certificates jq wget \
&& case $(arch) in \
"x86_64") \
wget -4 -q -O - https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION/lychee-x86_64-unknown-linux-musl.tar.gz | tar -xz lychee \
;; \
"aarch64") \
wget -4 -q -O - https://github.com/lycheeverse/lychee/releases/download/$LYCHEE_VERSION/lychee-arm-unknown-linux-musleabihf.tar.gz | tar -xz lychee \
;; \
esac \
RUN apk add --no-cache ca-certificates jq wget \
&& ARCH=$(case $(arch) in \
"x86_64") echo "x86_64-unknown-linux-musl";; \
"aarch64") echo "arm-unknown-linux-musleabihf";; \
*) 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 -4 -q -O - "$BASE_URL/lychee-$ARCH.tar.gz" | tar -xz lychee \
&& chmod +x lychee

FROM alpine:latest
Expand Down

0 comments on commit 01c38aa

Please sign in to comment.