From 7e04b8ea06bf3784e9060bcbfe20b85362adb98e Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Mon, 26 Feb 2024 16:02:38 +0100 Subject: [PATCH] [bitnami/kong] Release 3.6.0-debian-12-r0 (#63402) Signed-off-by: Bitnami Containers --- bitnami/kong/3/debian-12/Dockerfile | 17 ++++++++--------- .../opt/bitnami/.bitnami_components.json | 10 ++-------- .../rootfs/opt/bitnami/scripts/kong-env.sh | 4 +++- .../opt/bitnami/scripts/kong/entrypoint.sh | 6 ++++++ .../opt/bitnami/scripts/kong/postunpack.sh | 9 ++++++++- .../rootfs/opt/bitnami/scripts/libkong.sh | 6 +++--- bitnami/kong/3/debian-12/tags-info.yaml | 2 +- bitnami/kong/README.md | 4 +++- 8 files changed, 34 insertions(+), 24 deletions(-) diff --git a/bitnami/kong/3/debian-12/Dockerfile b/bitnami/kong/3/debian-12/Dockerfile index 27934f1316ad..9d4babe0a1ce 100644 --- a/bitnami/kong/3/debian-12/Dockerfile +++ b/bitnami/kong/3/debian-12/Dockerfile @@ -7,13 +7,13 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2024-02-01T09:28:44Z" \ + org.opencontainers.image.created="2024-02-26T14:42:16Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="3.5.0-debian-12-r4" \ + org.opencontainers.image.ref.name="3.6.0-debian-12-r0" \ org.opencontainers.image.title="kong" \ org.opencontainers.image.vendor="VMware, Inc." \ - org.opencontainers.image.version="3.5.0" + org.opencontainers.image.version="3.6.0" ENV HOME="/" \ OS_ARCH="${TARGETARCH:-amd64}" \ @@ -23,12 +23,11 @@ ENV HOME="/" \ COPY prebuildfs / SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"] # Install required system packages and dependencies -RUN install_packages ca-certificates curl libcrypt1 libgeoip1 libpcre3 libprotobuf-dev libssl3 perl procps zlib1g zlib1g-dev +RUN install_packages ca-certificates curl libabsl20220623 libaom3 libavif15 libbrotli1 libbsd0 libcrypt1 libdav1d6 libde265-0 libdeflate0 libexpat1 libfontconfig1 libfreetype6 libgav1-1 libgcc-s1 libgcrypt20 libgd3 libgeoip1 libgpg-error0 libheif1 libicu72 libjbig0 libjpeg62-turbo liblerc4 liblzma5 libmd0 libnuma1 libpcre3 libpng16-16 libprotobuf-dev librav1e0 libssl3 libstdc++6 libsvtav1enc1 libtiff6 libwebp7 libx11-6 libx265-199 libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxslt1.1 libyaml-0-2 libyuv0 libzstd1 perl procps zlib1g zlib1g-dev RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ COMPONENTS=( \ - "render-template-1.0.6-6-linux-${OS_ARCH}-debian-12" \ - "nginx-1.25.3-3-linux-${OS_ARCH}-debian-12" \ - "kong-3.5.0-2-linux-${OS_ARCH}-debian-12" \ + "render-template-1.0.6-9-linux-${OS_ARCH}-debian-12" \ + "kong-3.6.0-0-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ @@ -47,9 +46,9 @@ RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true COPY rootfs / RUN /opt/bitnami/scripts/kong/postunpack.sh -ENV APP_VERSION="3.5.0" \ +ENV APP_VERSION="3.6.0" \ BITNAMI_APP_NAME="kong" \ - PATH="/opt/bitnami/common/bin:/opt/bitnami/nginx/sbin:/opt/bitnami/kong/bin:/opt/bitnami/kong/luarocks/bin:/opt/bitnami/kong/openresty/bin:/opt/bitnami/kong/openresty/luajit/bin:/opt/bitnami/kong/openresty/nginx/sbin:$PATH" + PATH="/opt/bitnami/common/bin:/opt/bitnami/kong/bin:/opt/bitnami/kong/luarocks/bin:/opt/bitnami/kong/openresty/bin:/opt/bitnami/kong/openresty/luajit/bin:/opt/bitnami/kong/openresty/nginx/sbin:$PATH" EXPOSE 8000 8001 8443 8444 diff --git a/bitnami/kong/3/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/kong/3/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json index 8903ce42ef79..6031a0e78c27 100644 --- a/bitnami/kong/3/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/kong/3/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,18 +3,12 @@ "arch": "amd64", "distro": "debian-12", "type": "NAMI", - "version": "3.5.0-2" - }, - "nginx": { - "arch": "amd64", - "distro": "debian-12", - "type": "NAMI", - "version": "1.25.3-3" + "version": "3.6.0-0" }, "render-template": { "arch": "amd64", "distro": "debian-12", "type": "NAMI", - "version": "1.0.6-6" + "version": "1.0.6-9" } } \ No newline at end of file diff --git a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong-env.sh b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong-env.sh index 2647eb90686f..3c93fb2c1275 100644 --- a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong-env.sh +++ b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong-env.sh @@ -55,12 +55,14 @@ unset kong_env_vars # Paths export KONG_BASE_DIR="${BITNAMI_ROOT_DIR}/kong" +export KONG_PREFIX="${KONG_BASE_DIR}" export KONG_CONF_DIR="${KONG_BASE_DIR}/conf" +export KONG_DEFAULT_CONF_DIR="${KONG_BASE_DIR}/conf.default" export KONG_CONF_FILE="${KONG_CONF_DIR}/kong.conf" export KONG_DEFAULT_CONF_FILE="${KONG_CONF_DIR}/kong.conf.default" export KONG_INITSCRIPTS_DIR="/docker-entrypoint-initdb.d" export KONG_SERVER_DIR="${KONG_BASE_DIR}/server" -export KONG_LOGS_DIR="${KONG_SERVER_DIR}/logs" +export KONG_LOGS_DIR="${KONG_BASE_DIR}/logs" export PATH="${KONG_BASE_DIR}/bin:${KONG_BASE_DIR}/openresty/bin:${KONG_BASE_DIR}/openresty/nginx/sbin:${KONG_BASE_DIR}/luarocks/bin:${PATH}" # System users (when running with a privileged user) diff --git a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/entrypoint.sh b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/entrypoint.sh index fcce9604c854..572cabec7cc5 100755 --- a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/entrypoint.sh +++ b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/entrypoint.sh @@ -18,6 +18,12 @@ set -o pipefail print_welcome_page +# We add the copy from default config in the entrypoint to not break users +# bypassing the setup.sh logic. If the file already exists do not overwrite (in +# case someone mounts a configuration file in /opt/bitnami/kong/conf) +debug "Copying files from $KONG_DEFAULT_CONF_DIR to $KONG_CONF_DIR" +cp -nr "$KONG_DEFAULT_CONF_DIR"/. "$KONG_CONF_DIR" + if [[ "$*" = *"/opt/bitnami/scripts/kong/run.sh"* ]]; then info "** Starting Kong setup **" /opt/bitnami/scripts/kong/setup.sh diff --git a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/postunpack.sh b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/postunpack.sh index 3e8277460a5b..1ef2e7628152 100755 --- a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/postunpack.sh +++ b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/kong/postunpack.sh @@ -19,9 +19,11 @@ set -o pipefail # Ensure users and groups used by Kong exist ensure_user_exists "$KONG_DAEMON_USER" --group "$KONG_DAEMON_GROUP" # Ensure directories used by Kong exist and have proper permissions +ensure_dir_exists "$KONG_LOGS_DIR" ensure_dir_exists "$KONG_SERVER_DIR" ensure_dir_exists "$KONG_INITSCRIPTS_DIR" -chmod -R g+rwX "$KONG_SERVER_DIR" "$KONG_CONF_DIR" +ensure_dir_exists "$KONG_DEFAULT_CONF_DIR" +chmod -R g+rwX "$KONG_SERVER_DIR" "$KONG_CONF_DIR" "$KONG_BASE_DIR" # Copy configuration file and set default values cp "$KONG_DEFAULT_CONF_FILE" "$KONG_CONF_FILE" kong_conf_set prefix "$KONG_SERVER_DIR" @@ -29,3 +31,8 @@ kong_conf_set nginx_daemon off kong_conf_set nginx_user "$KONG_DAEMON_USER" kong_configure_non_empty_values install_opentelemetry +configure_lua_paths "/opt/bitnami/scripts/kong-env.sh" "/etc/bash.bashrc" + +# Copy all initially generated configuration files to the default directory +# (this is to avoid breaking when entrypoint is being overridden) +cp -r "${KONG_CONF_DIR}/"* "$KONG_DEFAULT_CONF_DIR" \ No newline at end of file diff --git a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/libkong.sh b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/libkong.sh index 40621df30fb2..b18228973698 100644 --- a/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/libkong.sh +++ b/bitnami/kong/3/debian-12/rootfs/opt/bitnami/scripts/libkong.sh @@ -336,7 +336,7 @@ kong_custom_init_scripts() { ######################### find_opentelemetry_source() { local path - path="$(find "$KONG_BASE_DIR" -name "opentelemetry" -print | grep "include")" + path="$(find "$KONG_BASE_DIR" -name "opentelemetry" -print | grep "include" | grep "luajit")" echo "$path" } @@ -353,7 +353,7 @@ install_opentelemetry() { local -r source_dir="$(find_opentelemetry_source)" local -r destination_dir="/usr/local/kong/include" mkdir -p "$destination_dir" - ln -s "$source_dir" "${destination_dir}/opentelemetry" + ln -sf "$source_dir" "${destination_dir}/opentelemetry" } ######################## @@ -369,7 +369,7 @@ configure_lua_paths() { local -a dest_files=("${@}") local -r lua_paths_file="/tmp/lua-paths.sh" # Skip the PATH environment variable. We are already setting it. - "${KONG_BASE_DIR}/luarocks/bin/luarocks" path > "$lua_paths_file" + "${KONG_BASE_DIR}/openresty/bin/luarocks" path > "$lua_paths_file" remove_in_file "$lua_paths_file" "^export\s+PATH=.*$" for dest_file in "${dest_files[@]}"; do echo "# 'luarocks path' configuration" >> "$dest_file" diff --git a/bitnami/kong/3/debian-12/tags-info.yaml b/bitnami/kong/3/debian-12/tags-info.yaml index 9504fbfd50c8..75d4c22d8d29 100644 --- a/bitnami/kong/3/debian-12/tags-info.yaml +++ b/bitnami/kong/3/debian-12/tags-info.yaml @@ -1,5 +1,5 @@ rolling-tags: - "3" - 3-debian-12 -- 3.5.0 +- 3.6.0 - latest diff --git a/bitnami/kong/README.md b/bitnami/kong/README.md index 588175655420..6c5230de067f 100644 --- a/bitnami/kong/README.md +++ b/bitnami/kong/README.md @@ -114,12 +114,14 @@ We can launch another containers using the same flag (`--network NETWORK`) in th | Name | Description | Value | |--------------------------|-----------------------------------------------------|--------------------------------------| | `KONG_BASE_DIR` | Kong installation directory. | `${BITNAMI_ROOT_DIR}/kong` | +| `KONG_PREFIX` | Kong installation directory. | `${KONG_BASE_DIR}` | | `KONG_CONF_DIR` | Kong configuration directory. | `${KONG_BASE_DIR}/conf` | +| `KONG_DEFAULT_CONF_DIR` | Kong configuration directory. | `${KONG_BASE_DIR}/conf.default` | | `KONG_CONF_FILE` | Kong configuration file. | `${KONG_CONF_DIR}/kong.conf` | | `KONG_DEFAULT_CONF_FILE` | Kong default configuration file. | `${KONG_CONF_DIR}/kong.conf.default` | | `KONG_INITSCRIPTS_DIR` | Kong directory for init scripts. | `/docker-entrypoint-initdb.d` | | `KONG_SERVER_DIR` | Directory where Kong Openresty instance is created. | `${KONG_BASE_DIR}/server` | -| `KONG_LOGS_DIR` | Directory where Kong logs are stored. | `${KONG_SERVER_DIR}/logs` | +| `KONG_LOGS_DIR` | Directory where Kong logs are stored. | `${KONG_BASE_DIR}/logs` | | `KONG_PID_FILE` | Path to the PID file for Kong. | `${KONG_SERVER_DIR}/pids/nginx.pid` | | `KONG_DAEMON_USER` | Kong system user. | `kong` | | `KONG_DAEMON_GROUP` | Kong system group. | `kong` |