Skip to content

Commit 147d9d1

Browse files
committed
build: handle trailing .0 segments in squid version for curl
1 parent c9a588c commit 147d9d1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ ARG SQUID_VERSION=7.4
2525
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2626

2727
WORKDIR /src
28-
RUN curl -L "https://github.com/squid-cache/squid/releases/download/SQUID_${SQUID_VERSION//./_}/squid-${SQUID_VERSION}.tar.gz" \
28+
RUN shopt -s extglob && \
29+
# extglob trims any trailing ".0" segments (e.g. 7.4.0 -> 7.4, 7.0.0 -> 7)
30+
SQUID_VERSION_CURL="${SQUID_VERSION%%+(.0)}" && \
31+
curl -L "https://github.com/squid-cache/squid/releases/download/SQUID_${SQUID_VERSION_CURL//./_}/squid-${SQUID_VERSION_CURL}.tar.gz" \
2932
| tar -xzf - --strip-components=1
3033

3134
FROM start AS builder

0 commit comments

Comments
 (0)