[bitnami/supabase-postgres] Release 15.1.0-debian-11-r29 (#30925)

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Bitnami Bot 2023-04-19 22:38:07 +02:00 committed by GitHub
parent aaf279f873
commit 923b7aed73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 109 additions and 21 deletions

View File

@ -5,10 +5,10 @@ ARG TARGETARCH
ARG WITH_ALL_LOCALES="no"
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
org.opencontainers.image.created="2023-04-18T08:58:35Z" \
org.opencontainers.image.created="2023-04-19T20:13:07Z" \
org.opencontainers.image.description="Application packaged by VMware, Inc" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="15.1.0-debian-11-r28" \
org.opencontainers.image.ref.name="15.1.0-debian-11-r29" \
org.opencontainers.image.title="supabase-postgres" \
org.opencontainers.image.vendor="VMware, Inc." \
org.opencontainers.image.version="15.1.0"
@ -24,9 +24,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN install_packages ca-certificates curl libbrotli1 libbsd0 libbz2-1.0 libcom-err2 libcrypt1 libcurl4 libedit2 libevent-2.1-7 libffi7 libgcc-s1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed6 libicu67 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblz4-1 liblzma5 libmd0 libmecab2 libmsgpackc2 libncurses6 libnettle8 libnghttp2-14 libnorm1 libp11-kit0 libpcre3 libpgm-5.3-0 libpsl5 libreadline8 librtmp1 libsasl2-2 libsodium23 libsqlite3-0 libssh2-1 libssl1.1 libstdc++6 libtasn1-6 libtinfo6 libunistring2 libuuid1 libxml2 libxslt1.1 libzmq5 libzstd1 locales procps zlib1g
RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \
COMPONENTS=( \
"java-17.0.6-10-4-linux-${OS_ARCH}-debian-11" \
"gosu-1.16.0-5-linux-${OS_ARCH}-debian-11" \
"supabase-postgres-15.1.0-23-linux-${OS_ARCH}-debian-11" \
"java-17.0.7-7-0-linux-${OS_ARCH}-debian-11" \
"supabase-postgres-15.1.0-24-linux-${OS_ARCH}-debian-11" \
) && \
for COMPONENT in "${COMPONENTS[@]}"; do \
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
@ -55,7 +54,7 @@ ENV APP_VERSION="15.1.0" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \
PATH="/opt/bitnami/java/bin:/opt/bitnami/common/bin:/opt/bitnami/postgresql/bin:$PATH" \
PATH="/opt/bitnami/java/bin:/opt/bitnami/postgresql/bin:$PATH" \
POSTGRESQL_SHARED_PRELOAD_LIBRARIES="pg_stat_statements, pg_stat_monitor, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain"
VOLUME [ "/bitnami/postgresql", "/docker-entrypoint-initdb.d", "/docker-entrypoint-preinitdb.d" ]

View File

@ -1,20 +1,14 @@
{
"gosu": {
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "1.16.0-5"
},
"java": {
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "17.0.6-10-4"
"version": "17.0.7-7-0"
},
"supabase-postgres": {
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "15.1.0-23"
"version": "15.1.0-24"
}
}

View File

@ -553,3 +553,98 @@ get_root_disk_device_id() {
get_root_disk_size() {
fdisk -l "$(get_root_disk_device_id)" | grep 'Disk.*bytes' | sed -E 's/.*, ([0-9]+) bytes,.*/\1/' || true
}
########################
# Run command as a specific user and group (optional)
# Arguments:
# $1 - USER(:GROUP) to switch to
# $2..$n - command to execute
# Returns:
# Exit code of the specified command
#########################
run_as_user() {
run_chroot "$@"
}
########################
# Execute command as a specific user and group (optional),
# replacing the current process image
# Arguments:
# $1 - USER(:GROUP) to switch to
# $2..$n - command to execute
# Returns:
# Exit code of the specified command
#########################
exec_as_user() {
run_chroot --replace-process "$@"
}
########################
# Run a command using chroot
# Arguments:
# $1 - USER(:GROUP) to switch to
# $2..$n - command to execute
# Flags:
# -r | --replace-process - Replace the current process image (optional)
# Returns:
# Exit code of the specified command
#########################
run_chroot() {
local userspec
local user
local homedir
local replace=false
local -r cwd="$(pwd)"
# Parse and validate flags
while [[ "$#" -gt 0 ]]; do
case "$1" in
-r | --replace-process)
replace=true
;;
--)
shift
break
;;
-*)
stderr_print "unrecognized flag $1"
return 1
;;
*)
break
;;
esac
shift
done
# Parse and validate arguments
if [[ "$#" -lt 2 ]]; then
echo "expected at least 2 arguments"
return 1
else
userspec=$1
shift
# userspec can optionally include the group, so we parse the user
user=$(echo "$userspec" | cut -d':' -f1)
fi
if ! am_i_root; then
error "Could not switch to '${userspec}': Operation not permitted"
return 1
fi
# Get the HOME directory for the user to switch, as chroot does
# not properly update this env and some scripts rely on it
homedir=$(eval echo "~${user}")
if [[ ! -d $homedir ]]; then
homedir="${HOME:-/}"
fi
# Obtaining value for "$@" indirectly in order to properly support shell parameter expansion
if [[ "$replace" = true ]]; then
exec chroot --userspec="$userspec" / bash -c "cd ${cwd}; export HOME=${homedir}; exec \"\$@\"" -- "$@"
else
chroot --userspec="$userspec" / bash -c "cd ${cwd}; export HOME=${homedir}; exec \"\$@\"" -- "$@"
fi
}

View File

@ -737,7 +737,7 @@ postgresql_stop() {
if [[ -f "$POSTGRESQL_PID_FILE" ]]; then
info "Stopping PostgreSQL..."
if am_i_root; then
gosu "$POSTGRESQL_DAEMON_USER" "${cmd[@]}"
run_as_user "$POSTGRESQL_DAEMON_USER" "${cmd[@]}"
else
"${cmd[@]}"
fi
@ -762,7 +762,7 @@ postgresql_start_bg() {
fi
local pg_ctl_cmd=()
if am_i_root; then
pg_ctl_cmd+=("gosu" "$POSTGRESQL_DAEMON_USER")
pg_ctl_cmd+=("run_as_user" "$POSTGRESQL_DAEMON_USER")
fi
pg_ctl_cmd+=("$POSTGRESQL_BIN_DIR"/pg_ctl)
if [[ "${BITNAMI_DEBUG:-false}" = true ]] || [[ $pg_logs = true ]]; then
@ -838,7 +838,7 @@ postgresql_master_init_db() {
fi
local initdb_cmd=()
if am_i_root; then
initdb_cmd+=("gosu" "$POSTGRESQL_DAEMON_USER")
initdb_cmd+=("run_as_user" "$POSTGRESQL_DAEMON_USER")
fi
initdb_cmd+=("$POSTGRESQL_BIN_DIR/initdb")
if [[ -n "${initdb_args[*]:-}" ]]; then
@ -869,7 +869,7 @@ postgresql_slave_init_db() {
local -r check_args=("-U" "$POSTGRESQL_REPLICATION_USER" "-h" "$POSTGRESQL_MASTER_HOST" "-p" "$POSTGRESQL_MASTER_PORT_NUMBER" "-d" "postgres")
local check_cmd=()
if am_i_root; then
check_cmd=("gosu" "$POSTGRESQL_DAEMON_USER")
check_cmd=("run_as_user" "$POSTGRESQL_DAEMON_USER")
fi
check_cmd+=("$POSTGRESQL_BIN_DIR"/pg_isready)
local ready_counter=$POSTGRESQL_INIT_MAX_TIMEOUT
@ -887,7 +887,7 @@ postgresql_slave_init_db() {
local -r backup_args=("-D" "$POSTGRESQL_DATA_DIR" "-U" "$POSTGRESQL_REPLICATION_USER" "-h" "$POSTGRESQL_MASTER_HOST" "-p" "$POSTGRESQL_MASTER_PORT_NUMBER" "-X" "stream" "-w" "-v" "-P")
local backup_cmd=()
if am_i_root; then
backup_cmd+=("gosu" "$POSTGRESQL_DAEMON_USER")
backup_cmd+=("run_as_user" "$POSTGRESQL_DAEMON_USER")
fi
backup_cmd+=("$POSTGRESQL_BIN_DIR"/pg_basebackup)
local replication_counter=$POSTGRESQL_INIT_MAX_TIMEOUT

View File

@ -24,7 +24,7 @@ cmd=$(command -v pg_autoctl)
info "** Starting PostgreSQL autoctl_node (Mode: $POSTGRESQL_AUTOCTL_MODE) **"
if am_i_root; then
exec gosu "$POSTGRESQL_DAEMON_USER" "$cmd" "${flags[@]}"
exec_as_user "$POSTGRESQL_DAEMON_USER" "$cmd" "${flags[@]}"
else
PGPASSWORD=$POSTGRESQL_REPLICATION_PASSWORD exec "$cmd" "${flags[@]}"
fi

View File

@ -27,7 +27,7 @@ cmd=$(command -v postgres)
info "** Starting PostgreSQL **"
if am_i_root; then
exec gosu "$POSTGRESQL_DAEMON_USER" "$cmd" "${flags[@]}"
exec_as_user "$POSTGRESQL_DAEMON_USER" "$cmd" "${flags[@]}"
else
exec "$cmd" "${flags[@]}"
fi