2.3.0-debian-10-r2 release

This commit is contained in:
Bitnami Bot 2021-01-16 02:42:16 +00:00
parent eb9f05ee94
commit 4c15e69ea0
4 changed files with 66 additions and 8 deletions

View File

@ -18,7 +18,7 @@ RUN chmod g+rwX /opt/bitnami
COPY rootfs /
RUN /opt/bitnami/scripts/kong/postunpack.sh
ENV BITNAMI_APP_NAME="kong" \
BITNAMI_IMAGE_VERSION="2.3.0-debian-10-r1" \
BITNAMI_IMAGE_VERSION="2.3.0-debian-10-r2" \
PATH="/opt/bitnami/kong/bin:/opt/bitnami/kong/openresty/bin:/opt/bitnami/kong/openresty/luajit/bin:/opt/bitnami/kong/openresty/nginx/sbin:/opt/bitnami/common/bin:$PATH"
EXPOSE 8000 8001 8443 8444

View File

@ -37,14 +37,34 @@ group_exists() {
# Create a group in the system if it does not exist already
# Arguments:
# $1 - group
# Flags:
# -s|--system - Whether to create new user as system user (uid <= 999)
# Returns:
# None
#########################
ensure_group_exists() {
local group="${1:?group is missing}"
local is_system_user=false
# Validate arguments
shift 1
while [ "$#" -gt 0 ]; do
case "$1" in
-s|--system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
if ! group_exists "$group"; then
groupadd "$group" >/dev/null 2>&1
local -a args=("$group")
$is_system_user && args+=("--system")
groupadd "${args[@]}" >/dev/null 2>&1
fi
}
@ -52,22 +72,60 @@ ensure_group_exists() {
# Create an user in the system if it does not exist already
# Arguments:
# $1 - user
# $2 - group
# Flags:
# -g|--group - the group the new user should belong to
# -h|--home - the home directory for the new user
# -s|--system - whether to create new user as system user (uid <= 999)
# Returns:
# None
#########################
ensure_user_exists() {
local user="${1:?user is missing}"
local group="${2:-}"
local group=""
local home=""
local is_system_user=false
# Validate arguments
shift 1
while [ "$#" -gt 0 ]; do
case "$1" in
-g|--group)
shift
group="${1:?missing group}"
;;
-h|--home)
shift
home="${1:?missing home directory}"
;;
-s|--system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
if ! user_exists "$user"; then
useradd "$user" >/dev/null 2>&1
local -a user_args=("-N" "$user")
$is_system_user && user_args+=("--system")
useradd "${user_args[@]}" >/dev/null 2>&1
fi
if [[ -n "$group" ]]; then
ensure_group_exists "$group"
local -a group_args=("$group")
$is_system_user && group_args+=("--system")
ensure_group_exists "${group_args[@]}"
usermod -a -G "$group" "$user" >/dev/null 2>&1
fi
if [[ -n "$home" ]]; then
mkdir -p "$home"
usermod -d "$home" "$user" >/dev/null 2>&1
configure_permissions_ownership "$home" -d "775" -f "664" -u "$user" -g "$group"
fi
}
########################

View File

@ -60,7 +60,7 @@ kong_configure_non_empty_values() {
eval "$(kong_env)"
# Ensure users and groups used by Kong exist
ensure_user_exists "$KONG_DAEMON_USER" "$KONG_DAEMON_GROUP"
ensure_user_exists "$KONG_DAEMON_USER" --group "$KONG_DAEMON_GROUP"
# Ensure directories used by Kong exist and have proper permissions
ensure_dir_exists "$KONG_SERVER_DIR"
ensure_dir_exists "$KONG_INITSCRIPTS_DIR"

View File

@ -37,7 +37,7 @@ Non-root container images add an extra layer of security and are generally recom
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/).
* [`2`, `2-debian-10`, `2.3.0`, `2.3.0-debian-10-r1`, `latest` (2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-kong/blob/2.3.0-debian-10-r1/2/debian-10/Dockerfile)
* [`2`, `2-debian-10`, `2.3.0`, `2.3.0-debian-10-r2`, `latest` (2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-kong/blob/2.3.0-debian-10-r2/2/debian-10/Dockerfile)
Subscribe to project updates by watching the [bitnami/kong GitHub repo](https://github.com/bitnami/bitnami-docker-kong).