Skip to content

Commit

Permalink
fix(ubuntu) 2.7.2 includes arm
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Jun 14, 2022
1 parent 84e21f2 commit 456bfc9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DO NOT update KONG_BUILD_TOOLS manually - it's set by update.sh
# to ensure same version is used here and in the respective kong version
KONG_BUILD_TOOLS?=4.23.0
BASE?=alpine

Expand Down
14 changes: 10 additions & 4 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ COPY kong.deb /tmp/kong.deb
ARG KONG_VERSION=2.7.2
ENV KONG_VERSION $KONG_VERSION

ARG KONG_SHA256="8124ddbfe80a1627b19a54e14b20ff0e176549699491cf5c61a4f0355470f8fc"
ARG KONG_AMD64_SHA="8124ddbfe80a1627b19a54e14b20ff0e176549699491cf5c61a4f0355470f8fc"
ARG KONG_ARM64_SHA="f40e616539ab64cb4fd333d19895ec9768b742bc25e5f2dbcb7f162bf90421d8"

# hadolint ignore=DL3015
RUN set -ex \
&& apt-get update \
RUN set -ex; \
arch=$(dpkg --print-architecture); \
case "${arch}" in \
amd64) KONG_SHA256=$KONG_AMD64_SHA ;; \
arm64) KONG_SHA256=$KONG_ARM64_SHA ;; \
esac; \
apt-get update \
&& if [ "$ASSET" = "ce" ] ; then \
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}_amd64.deb -o /tmp/kong.deb \
&& 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 \
&& apt-get purge -y curl \
&& echo "$KONG_SHA256 /tmp/kong.deb" | sha256sum -c -; \
else \
Expand Down
10 changes: 9 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ pushd ubuntu
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_AMD64_SHA=.*/ARG KONG_AMD64_SHA=\"'$new_sha'\"/g' Dockerfile

url=$(get_url Dockerfile arm64 "UBUNTU_CODENAME=focal")
echo $url
curl -fL $url -o /tmp/kong
new_sha=$(sha256sum /tmp/kong | cut -b1-64)

sed -i.bak 's/ARG KONG_ARM64_SHA=.*/ARG KONG_ARM64_SHA=\"'$new_sha'\"/g' Dockerfile

sed -i.bak 's/ARG KONG_VERSION=.*/ARG KONG_VERSION='$version'/g' Dockerfile
popd

Expand Down

0 comments on commit 456bfc9

Please sign in to comment.