diff --git a/Dockerfile.apk b/Dockerfile.apk index f47c1afd..075a1727 100644 --- a/Dockerfile.apk +++ b/Dockerfile.apk @@ -4,7 +4,6 @@ ARG KONG_VERSION=2.8.4 ENV KONG_VERSION $KONG_VERSION ARG KONG_AMD64_SHA="930b3b933b6c3f0393700433a919745900485d19e0cd8aba2d70aa066ccd10d2" -ARG KONG_ARM64_SHA="9027da2a4df477b462f34da9450412012ffdc0f9019e33ed7ff8e88f3df062c6" ARG KONG_PREFIX=/usr/local/kong ENV KONG_PREFIX $KONG_PREFIX @@ -15,15 +14,11 @@ ARG EE_PORTS COPY kong.apk.tar.gz /tmp/kong.apk.tar.gz RUN set -ex; \ - arch="$(apk --print-arch)"; \ major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \ - case "${arch}" in \ - x86_64) KONG_SHA256=$KONG_AMD64_SHA ;; \ - aarch64) KONG_SHA256=$KONG_ARM64_SHA ;; \ - esac; \ + KONG_SHA256=$KONG_AMD64_SHA ;; \ apk add bash curl ca-certificates; \ if [ "$ASSET" = "remote" ] ; then \ - curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/raw/names/kong-${arch}/versions/${KONG_VERSION}/kong-${KONG_VERSION}.${arch}.apk.tar.gz" -o /tmp/kong.apk.tar.gz \ + curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/alpine/any-version/main/x86_64/kong-${KONG_VERSION}.apk" -o /tmp/kong.apk.tar.gz \ && echo "$KONG_SHA256 /tmp/kong.apk.tar.gz" | sha256sum -c -; \ fi \ && apk add --no-cache --virtual .build-deps tar gzip \ diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 93973cd8..af74cdca 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -14,19 +14,15 @@ ARG KONG_VERSION=2.8.4 ENV KONG_VERSION $KONG_VERSION ARG KONG_AMD64_SHA="930b3b933b6c3f0393700433a919745900485d19e0cd8aba2d70aa066ccd10d2" -ARG KONG_ARM64_SHA="9027da2a4df477b462f34da9450412012ffdc0f9019e33ed7ff8e88f3df062c6" # hadolint ignore=DL3018 RUN set -eux; \ arch="$(apk --print-arch)"; \ major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \ - case "${arch}" in \ - x86_64) KONG_SHA256=$KONG_AMD64_SHA ;; \ - aarch64) KONG_SHA256=$KONG_ARM64_SHA ;; \ - esac; \ + KONG_SHA256=$KONG_AMD64_SHA ; \ if [ "$ASSET" = "ce" ] ; then \ apk add --no-cache --virtual .build-deps curl wget tar ca-certificates \ - && curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/raw/names/kong-${arch}/versions/${KONG_VERSION}/kong-${KONG_VERSION}.${arch}.apk.tar.gz" -o /tmp/kong.tar.gz \ + && curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/alpine/any-version/main/x86_64/kong-${KONG_VERSION}.apk" -o /tmp/kong.tar.gz \ && echo "$KONG_SHA256 /tmp/kong.tar.gz" | sha256sum -c - \ && apk del .build-deps; \ else \ diff --git a/rhel/Dockerfile b/rhel/Dockerfile index 8396d3ff..64017385 100644 --- a/rhel/Dockerfile +++ b/rhel/Dockerfile @@ -30,10 +30,9 @@ ARG RHEL_VERSION ENV RHEL_VERSION $RHEL_VERSION RUN set -ex; \ - arch='x86_64'; \ major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \ if [ "$ASSET" = "ce" ] ; then \ - curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/rpm/el/${RHEL_VERSION}/${arch}/kong-${KONG_VERSION}.el${RHEL_VERSION}.${arch}.rpm" -o /tmp/kong.rpm \ + curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/rpm/el/${RHEL_VERSION}/x86_64/kong-${KONG_VERSION}.el${RHEL_VERSION}.x86_64.rpm" -o /tmp/kong.rpm \ && echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \ else \ yum update -y \ diff --git a/update.sh b/update.sh index 6ff7489f..396d8fbc 100755 --- a/update.sh +++ b/update.sh @@ -52,6 +52,26 @@ if [[ -n "$kbt_in_kong_v" ]]; then sed -i.bak 's/KONG_BUILD_TOOLS?=.*/KONG_BUILD_TOOLS?='$kbt_in_kong_v'/g' Makefile fi +pushd alpine + url=$(get_url Dockerfile amd64) + echo $url + curl -fL $url -o /tmp/kong + new_sha=$(sha256sum /tmp/kong | cut -b1-64) + + sed -i.bak 's/ARG KONG_AMD64_SHA=.*/ARG KONG_AMD64_SHA=\"'$new_sha'\"/g' Dockerfile + sed -i.bak 's/ARG KONG_VERSION=.*/ARG KONG_VERSION='$version'/g' Dockerfile +popd + +pushd rhel + url=$(get_url Dockerfile amd64 "RHEL_VERSION=7") + echo $url + curl -fL $url -o /tmp/kong + new_sha=$(sha256sum /tmp/kong | cut -b1-64) + + sed -i.bak 's/ARG KONG_SHA256=.*/ARG KONG_SHA256=\"'$new_sha'\"/g' Dockerfile + sed -i.bak 's/ARG KONG_VERSION=.*/ARG KONG_VERSION='$version'/g' Dockerfile +popd + # Dockerfile.rpm url=$(get_url Dockerfile.rpm x86_64 "VERSION=8") echo $url