Skip to content

Commit

Permalink
feat(*): use cloudsmith URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
curiositycasualty committed Oct 4, 2023
1 parent 76d8c51 commit 15d1c75
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Dockerfile.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ RUN set -ex; \
arch='x86_64'; \
major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \
if [ "$ASSET" = "remote" ] ; then \
VERSION=$(grep '^VERSION_ID' /etc/os-release | cut -d = -f 2 | sed -e 's/^"//' -e 's/"$//' | cut -d . -f 1) \
DOWNLOAD_URL="https://packages.konghq.com/public/gateway-${major_minor}/rpm/el/8/${arch}/kong-${KONG_VERSION}-1.${arch}.rpm"; \
DOWNLOAD_URL="https://packages.konghq.com/public/gateway-${major_minor}/rpm/el/8/${arch}/kong-${KONG_VERSION}.el8.${arch}.rpm"; \
curl -fL $DOWNLOAD_URL -o /tmp/kong.rpm \
&& echo "${KONG_SHA256} /tmp/kong.rpm" | sha256sum -c -; \
fi \
Expand Down
3 changes: 2 additions & 1 deletion alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ ARG KONG_ARM64_SHA="f6c90eb9b126e049859f037e81f070f4116ac701c4e4b9ad2d1ec574fbe4
# 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; \
if [ "$ASSET" = "ce" ] ; then \
apk add --no-cache --virtual .build-deps curl wget tar ca-certificates \
&& curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-alpine/kong-$KONG_VERSION.$arch.apk.tar.gz" -o /tmp/kong.tar.gz \
&& 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 \
&& echo "$KONG_SHA256 /tmp/kong.tar.gz" | sha256sum -c - \
&& apk del .build-deps; \
else \
Expand Down
4 changes: 3 additions & 1 deletion rhel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ 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://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-$RHEL_VERSION/Packages/k/kong-$KONG_VERSION.rhel${RHEL_VERSION}.amd64.rpm" -o /tmp/kong.rpm \
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 \
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \
else \
yum update -y \
Expand Down
5 changes: 3 additions & 2 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ ARG KONG_ARM64_SHA="1d5c2064d44b76fbb3cabf168dc226e91fedb991ace32915297505d08967
# hadolint ignore=DL3015
RUN set -ex; \
arch=$(dpkg --print-architecture); \
major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \
case "${arch}" in \
amd64) KONG_SHA256=$KONG_AMD64_SHA ;; \
arm64) KONG_SHA256=$KONG_ARM64_SHA ;; \
esac; \
apt-get update \
&& if [ "$ASSET" = "ce" ] ; then \
CODENAME=$(grep -m1 VERSION_CODENAME /etc/os-release | cut -d = -f 2); \
apt-get install -y curl \
&& UBUNTU_CODENAME=$(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2) \
&& curl -fL https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-ubuntu-${UBUNTU_CODENAME}/pool/all/k/kong/kong_${KONG_VERSION}_$arch.deb -o /tmp/kong.deb \
&& curl -fL "https://packages.konghq.com/public/gateway-${major_minor}/deb/ubuntu/pool/${CODENAME}/main/k/ko/kong_${KONG_VERSION}/kong_${KONG_VERSION}_${arch}.deb" -o /tmp/kong.deb \
&& apt-get purge -y curl \
&& echo "$KONG_SHA256 /tmp/kong.deb" | sha256sum -c -; \
else \
Expand Down

0 comments on commit 15d1c75

Please sign in to comment.