From 4894e1419c3ae08b9577f58cd18e5f244fe563bc Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 12 Jun 2024 08:38:32 +0200 Subject: [PATCH] get rid of lastversion github ratelimit problem --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6eba94..43055ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -##### this stage will download latest deb package +##### this stage will download latest tarball FROM alpine:latest as prep @@ -6,8 +6,9 @@ ARG HUGO_ARCH=amd64 RUN \ apk --no-cache upgrade && \ - apk --no-cache add lastversion && \ - URL=$(lastversion --filter "hugo_extended_.*\-${HUGO_ARCH}\.tar\.gz$" --pre gohugoio/hugo --format assets) && \ + apk --no-cache add curl jq && \ + LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/gohugoio/hugo/releases/latest | jq --raw-output ".tag_name" | sed 's/^v//' ) && \ + URL="https://github.com/gohugoio/hugo/releases/download/v${LATEST_RELEASE}/hugo_extended_${LATEST_RELEASE}_linux-${HUGO_ARCH}.tar.gz " && \ echo "Downloading: ${URL}" && \ wget "${URL}" -O - | tar xzv -C /tmp