mirror of
https://github.com/Hopiu/lychee.git
synced 2026-05-11 15:23:11 +00:00
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>
This commit is contained in:
parent
c0be8c551b
commit
76dbd843f4
3 changed files with 34 additions and 23 deletions
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
|
@ -99,6 +99,8 @@ jobs:
|
|||
startsWith(github.ref, 'lychee-v') }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
"LYCHEE_VERSION=${{ github.ref == 'refs/heads/master' && 'nightly' || 'latest' }}"
|
||||
|
||||
- name: Push Image (alpine)
|
||||
uses: docker/build-push-action@v6
|
||||
|
|
@ -111,6 +113,8 @@ jobs:
|
|||
startsWith(github.ref, 'lychee-v') }}
|
||||
tags: ${{ steps.meta-alpine.outputs.tags }}
|
||||
labels: ${{ steps.meta-alpine.outputs.labels }}
|
||||
build-args: |
|
||||
"LYCHEE_VERSION=${{ github.ref == 'refs/heads/master' && 'nightly' || 'latest' }}"
|
||||
|
||||
- name: Update DockerHub description
|
||||
uses: peter-evans/dockerhub-description@v4
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
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 \
|
||||
&& case $(dpkg --print-architecture) in \
|
||||
"amd64") \
|
||||
wget -q -O - https://github.com/lycheeverse/lychee/releases/latest/download/lychee-x86_64-unknown-linux-gnu.tar.gz | tar -xz lychee \
|
||||
;; \
|
||||
"arm64") \
|
||||
wget -q -O - https://github.com/lycheeverse/lychee/releases/latest/download/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
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
FROM alpine:latest AS builder
|
||||
WORKDIR /builder
|
||||
|
||||
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/latest/download/lychee-x86_64-unknown-linux-musl.tar.gz | tar -xz lychee \
|
||||
;; \
|
||||
"aarch64") \
|
||||
wget -4 -q -O - https://github.com/lycheeverse/lychee/releases/latest/download/lychee-arm-unknown-linux-musleabihf.tar.gz | tar -xz lychee \
|
||||
;; \
|
||||
esac \
|
||||
ARG LYCHEE_VERSION="latest"
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue