Skip to content

Commit

Permalink
chore(*): delete alpine (unsupported) and release 3.4 (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Aug 11, 2023
1 parent 2207aa2 commit a5ff45c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/version2_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
package: [apk, deb, rpm]
package: [deb, rpm]

env:
BASE: ${{ matrix.package }}
Expand Down
55 changes: 0 additions & 55 deletions Dockerfile.apk

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile.deb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ FROM debian:bullseye-20230502-slim

LABEL maintainer="Kong Docker Maintainers <docker@konghq.com> (@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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7@sha256:6910799b75ad41f00891

LABEL maintainer="Kong Docker Maintainers <docker@konghq.com> (@team-gateway-bot)"

ARG KONG_VERSION=3.3.1
ARG KONG_VERSION=3.4.0
ENV KONG_VERSION $KONG_VERSION

# RedHat required labels
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
34 changes: 17 additions & 17 deletions build_your_own_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -73,9 +73,9 @@ ENV KONG_VERSION $KONG_VERSION
# https://download.konghq.com/gateway-<gateway-major-version>-<os>-<os_version>/repodata/<some-sha>-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-<gateway-major-version>-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-<gateway-major-version>-ubuntu/PULP_MANIFEST
# ARG KONG_AMD64_SHA="<amd64_sha>"
# ARG KONG_ARM64_SHA="<arm64_sha>"
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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" \
Expand All @@ -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
Expand Down
10 changes: 0 additions & 10 deletions customize/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion customize/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
23 changes: 4 additions & 19 deletions submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ fi
git checkout master
git pull

if ! grep -q "$version" Dockerfile.apk
if ! grep -q "$version" Dockerfile.deb
then
if [[ "$force" = "yes" ]]
then
echo "Forcing to use the tag even though it is not in master."

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
Expand Down Expand Up @@ -130,17 +130,15 @@ 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
mv library/kong.new library/kong

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|;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -227,7 +213,6 @@ then
}
if (!(in_rc_tag == 1)) {
gsub(", latest", "")
gsub(", alpine", "")
gsub(", ubuntu", "")
print
}
Expand Down
6 changes: 3 additions & 3 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
19 changes: 0 additions & 19 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5ff45c

Please sign in to comment.