From a5ff45ca9bcfd931cc777acdf4a8ad354114a5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garc=C3=ADa=20Cota?= Date: Fri, 11 Aug 2023 17:02:37 +0200 Subject: [PATCH] chore(*): delete alpine (unsupported) and release 3.4 (#668) --- .github/workflows/version2_test.yml | 2 +- Dockerfile.apk | 55 ----------------------------- Dockerfile.deb | 4 +-- Dockerfile.rpm | 4 +-- Makefile | 4 +-- build_your_own_images.md | 34 +++++++++--------- customize/packer.lua | 10 ------ customize/readme.md | 2 +- submit.sh | 23 +++--------- ubuntu/Dockerfile | 6 ++-- update.sh | 19 ---------- 11 files changed, 32 insertions(+), 131 deletions(-) delete mode 100644 Dockerfile.apk diff --git a/.github/workflows/version2_test.yml b/.github/workflows/version2_test.yml index b0e402ac..bc57d6e4 100644 --- a/.github/workflows/version2_test.yml +++ b/.github/workflows/version2_test.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - package: [apk, deb, rpm] + package: [deb, rpm] env: BASE: ${{ matrix.package }} diff --git a/Dockerfile.apk b/Dockerfile.apk deleted file mode 100644 index 57a1d977..00000000 --- a/Dockerfile.apk +++ /dev/null @@ -1,55 +0,0 @@ -# When you update this file substantially, please update build_your_own_images.md as well. -FROM alpine:3.17 - -LABEL maintainer="Kong Docker Maintainers (@team-gateway-bot)" - -ARG KONG_VERSION=3.3.1 -ENV KONG_VERSION $KONG_VERSION - -ARG KONG_AMD64_SHA="b544aa8d23b544b7ec48e943e3525f6c1f33b202522020eedf91784c87de1a3d" - -ARG KONG_PREFIX=/usr/local/kong -ENV KONG_PREFIX $KONG_PREFIX - -ARG ASSET=remote -ARG EE_PORTS - -COPY kong.apk.tar.gz /tmp/kong.apk.tar.gz - -RUN set -ex; \ - apk add --virtual .build-deps curl tar gzip ca-certificates; \ - export ARCH='amd64'; \ - KONG_SHA256=$KONG_AMD64_SHA ; \ - if [ "$ASSET" = "remote" ] ; then \ - curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-alpine/kong-${KONG_VERSION}.${ARCH}.apk.tar.gz" -o /tmp/kong.apk.tar.gz \ - && echo "$KONG_SHA256 /tmp/kong.apk.tar.gz" | sha256sum -c -; \ - fi \ - && tar -C / -xzf /tmp/kong.apk.tar.gz \ - && apk add --no-cache libstdc++ libgcc perl tzdata libcap zlib zlib-dev bash yaml \ - && adduser -S kong \ - && addgroup -S kong \ - && mkdir -p "${KONG_PREFIX}" \ - && chown -R kong:0 ${KONG_PREFIX} \ - && chown kong:0 /usr/local/bin/kong \ - && chmod -R g=u ${KONG_PREFIX} \ - && rm -rf /tmp/kong.apk.tar.gz \ - && ln -sf /usr/local/openresty/bin/resty /usr/local/bin/resty \ - && ln -sf /usr/local/openresty/luajit/bin/luajit /usr/local/bin/luajit \ - && ln -sf /usr/local/openresty/luajit/bin/luajit /usr/local/bin/lua \ - && ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx \ - && apk del .build-deps \ - && kong version - -COPY docker-entrypoint.sh /docker-entrypoint.sh - -USER kong - -ENTRYPOINT ["/docker-entrypoint.sh"] - -EXPOSE 8000 8443 8001 8444 $EE_PORTS - -STOPSIGNAL SIGQUIT - -HEALTHCHECK --interval=60s --timeout=10s --retries=10 CMD kong-health - -CMD ["kong", "docker-start"] diff --git a/Dockerfile.deb b/Dockerfile.deb index 30dee298..d283f745 100644 --- a/Dockerfile.deb +++ b/Dockerfile.deb @@ -3,10 +3,10 @@ FROM debian:bullseye-20230502-slim LABEL maintainer="Kong Docker Maintainers (@team-gateway-bot)" -ARG KONG_VERSION=3.3.1 +ARG KONG_VERSION=3.4.0 ENV KONG_VERSION $KONG_VERSION -ARG KONG_SHA256="e19cad618ec3408b99c276ee336331c21bf661852193b174268caad45e6e9ccb" +ARG KONG_SHA256="a9f22f5d155c6afd75e813fd463a456938b98d8847c75f235c6c7d1b3d0b3ba2" ARG KONG_PREFIX=/usr/local/kong ENV KONG_PREFIX $KONG_PREFIX diff --git a/Dockerfile.rpm b/Dockerfile.rpm index aed35958..baee1efc 100644 --- a/Dockerfile.rpm +++ b/Dockerfile.rpm @@ -3,7 +3,7 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7@sha256:6910799b75ad41f00891 LABEL maintainer="Kong Docker Maintainers (@team-gateway-bot)" -ARG KONG_VERSION=3.3.1 +ARG KONG_VERSION=3.4.0 ENV KONG_VERSION $KONG_VERSION # RedHat required labels @@ -18,7 +18,7 @@ LABEL name="Kong" \ # RedHat required LICENSE file approved path COPY LICENSE /licenses/ -ARG KONG_SHA256="18eddb3bc3799cb8fd84b48789fa226525437985aec4f5730f9e370728fd3bb7" +ARG KONG_SHA256="8c30e94f82302a840e5ff5beba344640348eff1d43f4f5f1207ca2c7680bdb58" ARG KONG_PREFIX=/usr/local/kong ENV KONG_PREFIX $KONG_PREFIX diff --git a/Makefile b/Makefile index 4844b280..85094511 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ # to ensure same version is used here and in the respective kong version KONG_BUILD_TOOLS?=4.33.19 -PACKAGE?=apk -BASE?=alpine +PACKAGE?=deb +BASE?=ubuntu DOCKER_TAG_PREFIX?=kong diff --git a/build_your_own_images.md b/build_your_own_images.md index 1ad3600d..8cb42d48 100644 --- a/build_your_own_images.md +++ b/build_your_own_images.md @@ -23,7 +23,7 @@ To build your Docker image, you will need to provide 1. A Dockerfile that installs the Kong Gateway from a location you specify ## Base image -You can use images derived from Alpine, RHEL, or Debian; Kong Software pushes `.apk`, `.deb`, and +You can use images derived from RHEL or Ubuntu; Kong Software pushes `.deb`, and `.rpm` packages to our [public package repository](https://download.konghq.com/). ## Entrypoint script @@ -36,7 +36,7 @@ directory where you are planning to run the command to build your Docker image. ## Create a Dockerfile to install Kong Gateway ### Decide how to get the Kong Gateway package -Kong Software provides `.apk`, `.deb`, and `.rpm` packages via our [public package +Kong Software provides `.deb`, and `.rpm` packages via our [public package repository](https://download.konghq.com/). Decide whether you want your Dockerfile to @@ -73,9 +73,9 @@ ENV KONG_VERSION $KONG_VERSION # https://download.konghq.com/gateway---/repodata/-primary.xml.gz # ARG KONG_SHA256="<.deb-or.rpm-SHA>" -# Uncomment to build a container using the .apk.tar.gz Kong Gateway package -# For .apk.tar.gz packages, the SHA is in -# https://download.konghq.com/gateway--alpine/PULP_MANIFEST +# Uncomment to build a container using the .deb.tar.gz Kong Gateway package +# For .deb.tar.gz packages, the SHA is in +# https://download.konghq.com/gateway--ubuntu/PULP_MANIFEST # ARG KONG_AMD64_SHA="" # ARG KONG_ARM64_SHA="" @@ -93,8 +93,8 @@ ARG EE_PORTS # Uncomment if you are installing a .deb # COPY kong.deb /tmp/kong.deb -# Uncomment if you are installing a .apk.tar.gz -# COPY kong.apk.tar.gz /tmp/kong.apk.tar.gz +# Uncomment if you are installing a .deb.tar.gz +# COPY kong.deb.tar.gz /tmp/kong.deb.tar.gz # hadolint ignore=DL3015 # Uncomment the following section if you are installing a .rpm @@ -125,7 +125,7 @@ ARG EE_PORTS # apt-get install -y curl; \ # if [ "$ASSET" = "remote" ] ; then \ # CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d = -f 2) \ -# && DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-debian-${CODENAME}/pool/all/k/kong/kong_${KONG_VERSION}_amd64.deb" \ +# && DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-ubuntu-${CODENAME}/pool/all/k/kong/kong_${KONG_VERSION}_amd64.deb" \ # && curl -fL $DOWNLOAD_URL -o /tmp/kong.deb \ # && echo "$KONG_SHA256 /tmp/kong.deb" | sha256sum -c -; \ # fi \ @@ -142,23 +142,23 @@ ARG EE_PORTS # && kong version \ # && apt-get purge curl -y -# Uncomment the following section if you are installing a .apk.tar.gz +# Uncomment the following section if you are installing a .deb.tar.gz # Edit the DOWNLOAD_URL line to install from a repository other than # download.konghq.com # RUN set -ex; \ -# apk add bash curl ca-certificates; \ -# arch="$(apk --print-arch)"; \ +# deb add bash curl ca-certificates; \ +# arch="$(deb --print-arch)"; \ # case "${arch}" in \ # x86_64) export ARCH='amd64'; KONG_SHA256=$KONG_AMD64_SHA ;; \ # aarch64) export ARCH='arm64'; KONG_SHA256=$KONG_ARM64_SHA ;; \ # esac; \ # if [ "$ASSET" = "remote" ] ; then \ -# curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-alpine/kong-${KONG_VERSION}.${ARCH}.apk.tar.gz" -o /tmp/kong.apk.tar.gz \ -# && echo "$KONG_SHA256 /tmp/kong.apk.tar.gz" | sha256sum -c -; \ +# curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-ubuntu/kong-${KONG_VERSION}.${ARCH}.deb.tar.gz" -o /tmp/kong.deb.tar.gz \ +# && echo "$KONG_SHA256 /tmp/kong.deb.tar.gz" | sha256sum -c -; \ # fi \ -# && apk add --no-cache --virtual .build-deps tar gzip \ -# && tar -C / -xzf /tmp/kong.apk.tar.gz \ -# && apk add --no-cache libstdc++ libgcc openssl pcre perl tzdata libcap zlib zlib-dev bash \ +# && deb add --no-cache --virtual .build-deps tar gzip \ +# && tar -C / -xzf /tmp/kong.deb.tar.gz \ +# && deb add --no-cache libstdc++ libgcc openssl pcre perl tzdata libcap zlib zlib-dev bash \ # && adduser -S kong \ # && addgroup -S kong \ # && mkdir -p "/usr/local/kong" \ @@ -170,7 +170,7 @@ ARG EE_PORTS # && ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/luajit \ # && ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/lua \ # && ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx \ -# && apk del .build-deps \ +# && deb del .build-deps \ # && kong version COPY docker-entrypoint.sh /docker-entrypoint.sh diff --git a/customize/packer.lua b/customize/packer.lua index b84e1ee0..3760db16 100644 --- a/customize/packer.lua +++ b/customize/packer.lua @@ -47,16 +47,6 @@ end local platforms = { { - check = "apk -V", -- check for alpine - commands = { -- run before anything else in build container - "apk update", - "apk add git", - "apk add wget", - "apk add zip", - "apk add gcc", - "apk add musl-dev", - }, - }, { check = "yum --version", -- check for rhel commands = { -- run before anything else in build container "yum -y install git", diff --git a/customize/readme.md b/customize/readme.md index 53ef2d95..f9850318 100644 --- a/customize/readme.md +++ b/customize/readme.md @@ -5,7 +5,7 @@ and/or a custom template file to it. ``` docker build \ - --build-arg KONG_BASE="kong:0.14.1-alpine" \ + --build-arg KONG_BASE="kong:0.14.1-ubuntu" \ --build-arg PLUGINS="kong-http-to-https,kong-upstream-jwt" \ --build-arg TEMPLATE="/mykong/nginx.conf" \ --build-arg "KONG_LICENSE_DATA=$KONG_LICENSE_DATA" \ diff --git a/submit.sh b/submit.sh index 70b4e1d0..4f6bc922 100755 --- a/submit.sh +++ b/submit.sh @@ -70,7 +70,7 @@ fi git checkout master git pull -if ! grep -q "$version" Dockerfile.apk +if ! grep -q "$version" Dockerfile.deb then if [[ "$force" = "yes" ]] then @@ -78,7 +78,7 @@ then git checkout "$version" - if ! grep -q "$version$" Dockerfile.apk + if ! grep -q "$version$" Dockerfile.deb then die "Error: version in build script doesn't match required version." fi @@ -130,8 +130,7 @@ git checkout -b release/$version if [ "$mode" = "patch" ] then - sed "s|$prev-alpine|$version-alpine|; - s|$prev-ubuntu|$version-ubuntu|; + sed "s|$prev-ubuntu|$version-ubuntu|; s|$prev,|$version,|; s|$prevcommit|$commit|; s|refs/tags/$prev|refs/tags/$version|" library/kong > library/kong.new @@ -139,8 +138,7 @@ then elif [ "$mode" = "rc" -a "$rc" -gt 1 ] then - sed "s|$prev-alpine|$version-alpine|; - s|$prev-ubuntu|$version-ubuntu|; + sed "s|$prev-ubuntu|$version-ubuntu|; s|, ${xy}rc$[rc-1]|, ${xy}rc${rc}|; s|$prev,|$version,|; s|$prevcommit|$commit|; @@ -165,12 +163,6 @@ then v = "'$version'" xy = "'$xy'" commit = "'$commit'" - print "Tags: " v "-alpine, " v ", " xy ", alpine" - print "GitCommit: " commit - print "GitFetch: refs/tags/" v - print "Directory: alpine" - print "Architectures: amd64" - print "" print "Tags: " v "-ubuntu" print "GitCommit: " commit print "GitFetch: refs/tags/" v @@ -211,12 +203,6 @@ then v = "'$version'" xy = "'$xy'" commit = "'$commit'" - print "Tags: " v "-alpine, " v ", " xy ", alpine, latest" - print "GitCommit: " commit - print "GitFetch: refs/tags/" v - print "Directory: alpine" - print "Architectures: amd64, arm64v8" - print "" print "Tags: " v "-ubuntu, " xy "-ubuntu, ubuntu" print "GitCommit: " commit print "GitFetch: refs/tags/" v @@ -227,7 +213,6 @@ then } if (!(in_rc_tag == 1)) { gsub(", latest", "") - gsub(", alpine", "") gsub(", ubuntu", "") print } diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index ecd6c562..38aed4b8 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -9,11 +9,11 @@ ARG EE_PORTS COPY kong.deb /tmp/kong.deb -ARG KONG_VERSION=3.3.1 +ARG KONG_VERSION=3.4.0 ENV KONG_VERSION $KONG_VERSION -ARG KONG_AMD64_SHA="3aa6625933b60c8a4669a3623bcd3a3d736dfd807bbc314ea8989cd63c117a20" -ARG KONG_ARM64_SHA="3fd20cd0e45e81d858b54d3e40992d73ac9d7d11e398c0d02854ff69988657dd" +ARG KONG_AMD64_SHA="9a4203174a29895d5dd71092a05b15b26ee9644e068d14d970aed28461d358fa" +ARG KONG_ARM64_SHA="b64e19216ce125039a6a832dc93bf277e05f233a91f1647b351cad3f166edd81" # hadolint ignore=DL3015 RUN set -ex; \ diff --git a/update.sh b/update.sh index b4769e23..46a44bea 100755 --- a/update.sh +++ b/update.sh @@ -52,25 +52,6 @@ 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.apk 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.apk - sed -i.bak 's/ARG KONG_VERSION=.*/ARG KONG_VERSION='$version'/g' Dockerfile.apk - - # Note: Our Bazel-based build currently (3.2.x) does not support Alpine arm64 builds - # url=$(get_url Dockerfile.apk arm64) - # 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.apk - # sed -i.bak 's/ARG KONG_VERSION=.*/ARG KONG_VERSION='$version'/g' Dockerfile.apk -#popd - # Dockerfile.deb url=$(get_url Dockerfile.rpm amd64 "VERSION=8") echo $url