Skip to content

Commit

Permalink
Merge branch 'Kong:master' into kong-path-allow
Browse files Browse the repository at this point in the history
  • Loading branch information
gabeio committed Feb 21, 2024
2 parents e51b614 + 3d393c7 commit fac4de0
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 416 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/auto-assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Add assignee to PRs
on:
pull_request:
types: [ opened, reopened ]
permissions:
pull-requests: write
jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@2daaeb2988aef24bf37e636fe733f365c046aba0

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
58 changes: 0 additions & 58 deletions Dockerfile.apk

This file was deleted.

7 changes: 3 additions & 4 deletions Dockerfile.deb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# When you update this file substantially, please update build_your_own_images.md as well.
FROM debian:bullseye-20230227-slim
FROM debian:bullseye-20230502-slim

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

ARG KONG_VERSION=3.1.1
ARG KONG_VERSION=3.6.0
ENV KONG_VERSION $KONG_VERSION

ARG KONG_SHA256="c9cd059e13f9eb5ee894f2d83dc0a77c649adbb636fcbfed66841960b6f00f0d"
ARG KONG_SHA256="e5799bcd5c812dbc5b8bba04a9fad817a75781c3084daafcf83671e0c604d753"

ARG KONG_PREFIX=/usr/local/kong
ENV KONG_PREFIX $KONG_PREFIX
Expand Down
6 changes: 3 additions & 3 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.1.1
ARG KONG_VERSION=3.6.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="70e43c48c2c404d7a8092a13a5857e36d469668d508b19f7fe70c4351c7b533d"
ARG KONG_SHA256="806fa565b5c6e88410d2b0a3bfa3a8ca7591910387b089457709935783b611f0"

ARG KONG_PREFIX=/usr/local/kong
ENV KONG_PREFIX $KONG_PREFIX
Expand All @@ -31,7 +31,7 @@ COPY kong.rpm /tmp/kong.rpm
# hadolint ignore=DL3015
RUN set -ex; \
if [ "$ASSET" = "remote" ] ; then \
DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-8/Packages/k/kong-$KONG_VERSION.rhel8.6.amd64.rpm" \
DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-8/Packages/k/kong-$KONG_VERSION.rhel8.amd64.rpm" \
&& curl -fL $DOWNLOAD_URL -o /tmp/kong.rpm \
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c - \
|| exit 1; \
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
31 changes: 21 additions & 10 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.9'

x-kong-config: &kong-env
x-kong-config:
&kong-env
KONG_DATABASE: ${KONG_DATABASE:-off}
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: db
Expand All @@ -11,12 +12,12 @@ volumes:
kong_data: {}
kong_prefix_vol:
driver_opts:
type: tmpfs
device: tmpfs
type: tmpfs
device: tmpfs
kong_tmp_vol:
driver_opts:
type: tmpfs
device: tmpfs
type: tmpfs
device: tmpfs

networks:
kong-net:
Expand All @@ -26,7 +27,7 @@ services:
kong-migrations:
image: "${KONG_DOCKER_TAG:-kong:latest}"
command: kong migrations bootstrap
profiles: ["database"]
profiles: [ "database" ]
depends_on:
- db
environment:
Expand All @@ -40,7 +41,7 @@ services:
kong-migrations-up:
image: "${KONG_DOCKER_TAG:-kong:latest}"
command: kong migrations up && kong migrations finish
profiles: ["database"]
profiles: [ "database" ]
depends_on:
- db
environment:
Expand All @@ -60,6 +61,7 @@ services:
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_PROXY_LISTEN: "${KONG_PROXY_LISTEN:-0.0.0.0:8000}"
KONG_ADMIN_LISTEN: "${KONG_ADMIN_LISTEN:-0.0.0.0:8001}"
KONG_ADMIN_GUI_LISTEN: "${KONG_ADMIN_GUI_LISTEN:-0.0.0.0:8002}"
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_PREFIX: ${KONG_PREFIX:-/var/run/kong}
Expand All @@ -80,8 +82,9 @@ services:

- "127.0.0.1:8001:8001/tcp"
- "127.0.0.1:8444:8444/tcp"
- "127.0.0.1:8002:8002/tcp"
healthcheck:
test: ["CMD", "kong", "health"]
test: [ "CMD", "kong", "health" ]
interval: 10s
timeout: 10s
retries: 10
Expand All @@ -96,15 +99,23 @@ services:

db:
image: postgres:9.5
profiles: ["database"]
profiles: [ "database" ]
environment:
POSTGRES_DB: ${KONG_PG_DATABASE:-kong}
POSTGRES_USER: ${KONG_PG_USER:-kong}
POSTGRES_PASSWORD_FILE: /run/secrets/kong_postgres_password
secrets:
- kong_postgres_password
healthcheck:
test: ["CMD", "pg_isready", "-U", "${KONG_PG_USER:-kong}"]
test:
[
"CMD",
"pg_isready",
"-d",
"${KONG_PG_DATABASE:-kong}",
"-U",
"${KONG_PG_USER:-kong}"
]
interval: 30s
timeout: 30s
retries: 3
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

0 comments on commit fac4de0

Please sign in to comment.