Skip to content

Commit

Permalink
support VERSION arg
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Apr 13, 2023
1 parent ea0f908 commit badbb00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Expand Up @@ -13,13 +13,16 @@ FROM osmap-$TARGETOS AS osmap

FROM alpine AS fetcher
WORKDIR /app
ARG VERSION
RUN \
--mount=from=osmap,source=/os,target=/os <<EOF
set -eux
apk add --no-cache curl
export url=https://github.com/bojand/ghz/releases
export arch=x86_64
export VERSION=$( ( curl -#fSLo /dev/null -w '%{url_effective}' $url/latestecho ) | while read -r x; do basename $x; done)
if [ "${VERSION:-}" = '' ]; then
export VERSION=$( ( curl -#fSLo /dev/null -w '%{url_effective}' $url/latest && echo ) | while read -r x; do basename $x; done)
fi
curl -#fSLo exe.tar.gz $url/download/$VERSION/ghz-$(cat /os)-$arch.tar.gz
curl -#fSLo sha2 $url/download/$VERSION/ghz-$(cat /os)-$arch.tar.gz.sha256
sha256sum exe.tar.gz | grep -F $(cat sha2)
Expand Down

0 comments on commit badbb00

Please sign in to comment.