[bitnami/percona-mysql] Release 8.4.8-8-debian-12-r11 (#94626)

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
This commit is contained in:
Bitnami Bot
2026-06-11 01:39:08 +02:00
committed by GitHub
parent 3839558200
commit 3d17d4a0f5
13 changed files with 144 additions and 82 deletions
@@ -3,11 +3,11 @@
FROM docker.io/bitnami/minideb:bookworm
ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
ARG DOWNLOADS_URL="https://downloads.bitnami.com/files/stacksmith"
ARG TARGETARCH
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2026-05-29T19:03:52Z" \
org.opencontainers.image.created="2026-06-10T22:21:46Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/percona-mysql/README.md" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/percona-mysql" \
@@ -29,12 +29,12 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
COMPONENTS=( \
"mysql-shell-8.4.9-1-linux-${OS_ARCH}-debian-12" \
"ini-file-1.4.9-10-linux-${OS_ARCH}-debian-12" \
"ini-file-1.4.9-12-linux-${OS_ARCH}-debian-12" \
"percona-mysql-8.4.8-8-0-linux-${OS_ARCH}-debian-12" \
) ; \
for COMPONENT in "${COMPONENTS[@]}"; do \
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \
curl -SsLf "${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \
fi ; \
sha256sum -c "/opt/bitnami/checksums/${COMPONENT}.tar.gz.sha256" ; \
tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner ; \
@@ -52,7 +52,7 @@ COPY rootfs /
RUN /opt/bitnami/scripts/mysql/postunpack.sh
ENV APP_VERSION="8.4.8-8" \
BITNAMI_APP_NAME="percona-mysql" \
IMAGE_REVISION="10" \
IMAGE_REVISION="11" \
MYSQL_HOME="/opt/bitnami/mysql/conf" \
PATH="/opt/bitnami/mysql/bin:/opt/bitnami/common/bin:/opt/bitnami/mysql/sbin:$PATH"
@@ -1 +0,0 @@
7576302f2870643e4c48e7a4be12fef12e472e68b0b407e6033f812c8742c1f1 ini-file-1.4.9-10-linux-amd64-debian-12.tar.gz
@@ -1 +0,0 @@
83dd2355db6b63fc46bb02008fdace7510b339c88d91d45abaa256f2a7ae54bd ini-file-1.4.9-10-linux-arm64-debian-12.tar.gz
@@ -0,0 +1 @@
aba4a9b96e5a3b29743fe09c4b3279c789bace4171fe34574d166668dfc59523 ini-file-1.4.9-12-linux-amd64-debian-12.tar.gz
@@ -0,0 +1 @@
262a2d83e7294bb3adf0664ece04686f162a6355713981c7677634f2645505f0 ini-file-1.4.9-12-linux-arm64-debian-12.tar.gz
@@ -170,7 +170,7 @@ ensure_user_exists() {
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"
configure_permissions_ownership "$home" -d "775" -f "664" -u "$user" -g "$group" -n
fi
}
@@ -20,7 +20,7 @@
#########################
is_int() {
local -r int="${1:?missing value}"
if [[ "$int" =~ ^-?[0-9]+ ]]; then
if [[ "$int" =~ ^-?[0-9]+$ ]]; then
true
else
false
@@ -49,3 +49,36 @@ get_sematic_version () {
fi
fi
}
########################
# Compares two semantic versions
# Arguments:
# $1 - version1: first version to compare
# $2 - version2: second version to compare
# Returns:
# -1 if version1 is less than version2
# 0 if version1 is equal to version2
# 1 if version1 is greater than version2
#########################
compare_semantic_versions() {
local version1="${1:?version1 is required}"
local version2="${2:?version2 is required}"
local major1 major2 minor1 minor2 patch1 patch2
major1="$(get_sematic_version "$version1" 1)"
major2="$(get_sematic_version "$version2" 1)"
minor1="$(get_sematic_version "$version1" 2)"
minor2="$(get_sematic_version "$version2" 2)"
patch1="$(get_sematic_version "$version1" 3)"
patch2="$(get_sematic_version "$version2" 3)"
if [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -eq "$minor2" ]] && [[ "$patch1" -eq "$patch2" ]]; then
echo "0"
elif [[ "$major1" -lt "$major2" ]] ||
{ [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -lt "$minor2" ]]; } ||
{ [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -eq "$minor2" ]] && [[ "$patch1" -lt "$patch2" ]]; }; then
echo "-1"
else
echo "1"
fi
}
@@ -96,6 +96,10 @@ mysql_validate() {
if [[ -z "$DB_MASTER_HOST" ]]; then
print_validation_error "Slave replication mode chosen without setting the environment variable $(get_env_var MASTER_HOST). Use it to indicate where the Master node is running"
fi
if ! is_boolean_yes "$DB_REPLICATION_USE_SSL"; then
warn "SSL is not enabled for replication. MITM substitution of the RSA public key can recover DB_REPLICATION_PASSWORD."
fi
else
print_validation_error "Invalid replication mode. Available options are 'master/slave'"
fi
@@ -179,6 +183,27 @@ pid_file=${DB_PID_FILE}
EOF
}
########################
# Helper to get the SSL clause for replication
# Globals:
# DB_*
# Arguments:
# None
# Returns:
# SSL clause for replication
#########################
mysql_replication_ssl_clause() {
local replication_ssl_clause
if is_boolean_yes "$DB_REPLICATION_USE_SSL"; then
replication_ssl_clause="SOURCE_SSL=1,"
ca_file="$(mysql_client_env_value "SSL_CA_FILE")"
[[ -f "$ca_file" ]] && replication_ssl_clause+=" SOURCE_SSL_CA='${ca_file}', SOURCE_SSL_VERIFY_SERVER_CERT=1,"
else
replication_ssl_clause="GET_SOURCE_PUBLIC_KEY=1,"
fi
echo "$replication_ssl_clause"
}
########################
# Make a dump on master database and update slave database
# Globals:
@@ -191,11 +216,13 @@ EOF
mysql_exec_initial_dump() {
local -r dump_file="${DB_DATA_DIR}/dump_all_databases.sql"
local ssl_flags=()
is_boolean_yes "$DB_REPLICATION_USE_SSL" && ssl_flags+=("--ssl-mode=REQUIRED")
ca_file="$(mysql_client_env_value "SSL_CA_FILE")"
[[ -f "$ca_file" ]] && ssl_flags+=("--ssl-ca=${ca_file}")
info "MySQL dump master data start..."
# Avoid passing credentials as arguments to mysqldump, to avoid leaking them given a local observer with /proc read access can read them
local root_password_file
root_password_file="$(credential_to_temp_file "$DB_MASTER_ROOT_PASSWORD")"
mysqldump --verbose --single-transaction --quick --source-data=2 --all-databases -h "$DB_MASTER_HOST" -P "$DB_MASTER_PORT_NUMBER" -u "$DB_MASTER_ROOT_USER" -p"$(<"$root_password_file")" > "$dump_file"
MYSQL_PWD="$DB_MASTER_ROOT_PASSWORD" mysqldump --verbose --single-transaction --quick --source-data=2 --all-databases -h "$DB_MASTER_HOST" -P "$DB_MASTER_PORT_NUMBER" -u "$DB_MASTER_ROOT_USER" "${ssl_flags[@]}" > "$dump_file"
debug "Finish dump databases"
# Look for the line containing "CHANGE REPLICATION SOURCE"
@@ -218,8 +245,8 @@ SOURCE_PASSWORD='$DB_REPLICATION_PASSWORD',
SOURCE_DELAY=$DB_MASTER_DELAY,
SOURCE_LOG_FILE='$log_file',
SOURCE_LOG_POS=$log_position,
SOURCE_CONNECT_RETRY=10,
GET_SOURCE_PUBLIC_KEY=1;
$(mysql_replication_ssl_clause)
SOURCE_CONNECT_RETRY=10;
EOF
debug "Finish import dump databases"
@@ -255,8 +282,8 @@ SOURCE_PORT=$DB_MASTER_PORT_NUMBER,
SOURCE_USER='$DB_REPLICATION_USER',
SOURCE_PASSWORD='$DB_REPLICATION_PASSWORD',
SOURCE_DELAY=$DB_MASTER_DELAY,
SOURCE_CONNECT_RETRY=10,
GET_SOURCE_PUBLIC_KEY=1;
$(mysql_replication_ssl_clause)
SOURCE_CONNECT_RETRY=10;
EOF
fi
@@ -288,7 +315,7 @@ create user '$user'@'%' $([ "$password" != "" ] && echo "identified by \"$passwo
EOF
mysql_execute "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <<EOF
grant REPLICATION SLAVE on *.* to '$user'@'%' with grant option;
grant REPLICATION SLAVE on *.* to '$user'@'%';
flush privileges;
EOF
}
@@ -635,12 +662,6 @@ mysql_execute_print_output() {
fi
args+=("-N" "-u" "$user")
[[ -n "$db" ]] && args+=("$db")
# Avoid passing credentials as arguments to mysql, to avoid leaking them given a local observer with /proc read access can read them
if [[ -n "$pass" ]]; then
local pass_file
pass_file="$(credential_to_temp_file "$pass")"
args+=("-p$(<"$pass_file")")
fi
[[ "${#opts[@]}" -gt 0 ]] && args+=("${opts[@]}")
[[ "${#extra_opts[@]}" -gt 0 ]] && args+=("${extra_opts[@]}")
@@ -648,11 +669,19 @@ mysql_execute_print_output() {
if [[ "${BITNAMI_DEBUG:-false}" = true ]]; then
local mysql_cmd
mysql_cmd="$(</dev/stdin)"
"$(mysql_binary)" "${args[@]}" <<<"$mysql_cmd"
if [[ -n "$pass" ]]; then
MYSQL_PWD="$pass" "$(mysql_binary)" "${args[@]}" <<<"$mysql_cmd"
else
"$(mysql_binary)" "${args[@]}" <<<"$mysql_cmd"
fi
else
# Do not store the command(s) as a variable, to avoid issues when importing large files
# https://github.com/bitnami/bitnami-docker-mariadb/issues/251
"$(mysql_binary)" "${args[@]}"
if [[ -n "$pass" ]]; then
MYSQL_PWD="$pass" "$(mysql_binary)" "${args[@]}"
else
"$(mysql_binary)" "${args[@]}"
fi
fi
}
@@ -1364,13 +1393,10 @@ mysql_healthcheck() {
root_password="$(get_master_env_var_value ROOT_PASSWORD)"
if [[ -n "$root_password" ]]; then
# Avoid passing credentials as arguments to mysqladmin, to avoid leaking them given a local observer with /proc read access can read them
local root_password_file
root_password_file="$(credential_to_temp_file "$root_password")"
args+=("-p$(<"$root_password_file")")
MYSQL_PWD="$root_password" mysqladmin "${args[@]}" ping && MYSQL_PWD="$root_password" mysqladmin "${args[@]}" status
else
mysqladmin "${args[@]}" ping && mysqladmin "${args[@]}" status
fi
mysqladmin "${args[@]}" ping && mysqladmin "${args[@]}" status
}
########################
@@ -1390,6 +1416,17 @@ mysql_client_flavor() {
fi
}
# Helper to get the proper value for the MySQL client environment variable
mysql_client_env_value() {
local env_name="MYSQL_CLIENT_${1:?missing name}"
if [[ -n "${!env_name:-}" ]]; then
echo "${!env_name:-}"
else
env_name="DB_CLIENT_${1}"
echo "${!env_name:-}"
fi
}
########################
# Prints extra options for MySQL client calls (i.e. SSL options)
# Globals:
@@ -1400,16 +1437,6 @@ mysql_client_flavor() {
# List of options to pass to "mysql" CLI
#########################
mysql_client_extra_opts() {
# Helper to get the proper value for the MySQL client environment variable
mysql_client_env_value() {
local env_name="MYSQL_CLIENT_${1:?missing name}"
if [[ -n "${!env_name:-}" ]]; then
echo "${!env_name:-}"
else
env_name="DB_CLIENT_${1}"
echo "${!env_name:-}"
fi
}
local -a opts=()
local key value
if is_boolean_yes "${DB_ENABLE_SSL:-no}"; then
@@ -50,6 +50,7 @@ mysql_env_vars=(
MYSQL_UPGRADE
MYSQL_IS_DEDICATED_SERVER
MYSQL_CLIENT_ENABLE_SSL
MYSQL_REPLICATION_USE_SSL
MYSQL_CLIENT_SSL_CA_FILE
MYSQL_CLIENT_SSL_CERT_FILE
MYSQL_CLIENT_SSL_KEY_FILE
@@ -158,6 +159,8 @@ export MYSQL_IS_DEDICATED_SERVER="${MYSQL_IS_DEDICATED_SERVER:-}"
export DB_IS_DEDICATED_SERVER="$MYSQL_IS_DEDICATED_SERVER"
export MYSQL_CLIENT_ENABLE_SSL="${MYSQL_CLIENT_ENABLE_SSL:-no}"
export DB_CLIENT_ENABLE_SSL="$MYSQL_CLIENT_ENABLE_SSL"
export MYSQL_REPLICATION_USE_SSL="${MYSQL_REPLICATION_USE_SSL:-$DB_CLIENT_ENABLE_SSL}"
export DB_REPLICATION_USE_SSL="$MYSQL_REPLICATION_USE_SSL"
export MYSQL_CLIENT_SSL_CA_FILE="${MYSQL_CLIENT_SSL_CA_FILE:-}"
export DB_CLIENT_SSL_CA_FILE="$MYSQL_CLIENT_SSL_CA_FILE"
export MYSQL_CLIENT_SSL_CERT_FILE="${MYSQL_CLIENT_SSL_CERT_FILE:-}"
@@ -15,6 +15,4 @@ set -o pipefail
# Load Percona Server for MySQL environment variables
. /opt/bitnami/scripts/mysql-env.sh
# Ensure we clean up temporary files when this script ends
trap "cleanup_credentials" EXIT
mysql_healthcheck
@@ -21,8 +21,8 @@ set -o pipefail
rm -rf "${DB_SOCKET_FILE}.lock"
# Ensure Percona Server for MySQL environment variables settings are valid
mysql_validate
# Ensure Percona Server for MySQL is stopped when this script ends and we clean up temporary files
trap "mysql_stop; cleanup_credentials" EXIT
# Ensure Percona Server for MySQL is stopped when this script ends
trap "mysql_stop" EXIT
if am_i_root; then
# Ensure 'daemon' user exists when running as 'root'
ensure_user_exists "$DB_DAEMON_USER" --group "$DB_DAEMON_GROUP"
+37 -36
View File
@@ -48,42 +48,43 @@ The Bitnami Percona Server for MySQL Docker image is only available to [Bitnami
### Customizable environment variables
| Name | Description | Default Value |
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------|---------------|
| `ALLOW_EMPTY_PASSWORD` | Allow Percona Server for MySQL access without any password. | `no` |
| `MYSQL_AUTHENTICATION_PLUGIN` | Percona Server for MySQL authentication plugin to configure during the first initialization. | `nil` |
| `MYSQL_ROOT_USER` | Percona Server for MySQL database root user. | `root` |
| `MYSQL_ROOT_PASSWORD` | Percona Server for MySQL database root user password. | `nil` |
| `MYSQL_USER` | Percona Server for MySQL database user to create during the first initialization. | `nil` |
| `MYSQL_PASSWORD` | Password for the Percona Server for MySQL database user to create during the first initialization. | `nil` |
| `MYSQL_DATABASE` | Percona Server for MySQL database to create during the first initialization. | `nil` |
| `MYSQL_MASTER_HOST` | Address for the Percona Server for MySQL master node. | `nil` |
| `MYSQL_MASTER_PORT_NUMBER` | Port number for the Percona Server for MySQL master node. | `3306` |
| `MYSQL_MASTER_ROOT_USER` | Percona Server for MySQL database root user of the master host. | `root` |
| `MYSQL_MASTER_ROOT_PASSWORD` | Password for the Percona Server for MySQL database root user of the the master host. | `nil` |
| `MYSQL_MASTER_DELAY` | Percona Server for MySQL database replication delay. | `0` |
| `MYSQL_REPLICATION_USER` | Percona Server for MySQL replication database user. | `nil` |
| `MYSQL_REPLICATION_PASSWORD` | Password for the Percona Server for MySQL replication database user. | `nil` |
| `MYSQL_PORT_NUMBER` | Port number to use for the Percona Server for MySQL Server service. | `nil` |
| `MYSQL_REPLICATION_MODE` | Percona Server for MySQL replication mode. | `nil` |
| `MYSQL_REPLICATION_SLAVE_DUMP` | Make a dump on master and update slave Percona Server for MySQL database | `false` |
| `MYSQL_EXTRA_FLAGS` | Extra flags to be passed to start the Percona Server for MySQL Server. | `nil` |
| `MYSQL_INIT_SLEEP_TIME` | Sleep time when waiting for Percona Server for MySQL init configuration operations to finish. | `nil` |
| `MYSQL_CHARACTER_SET` | Percona Server for MySQL collation to use. | `nil` |
| `MYSQL_COLLATE` | Percona Server for MySQL collation to use. | `nil` |
| `MYSQL_BIND_ADDRESS` | Percona Server for MySQL bind address. | `nil` |
| `MYSQL_SQL_MODE` | Percona Server for MySQL Server SQL modes to enable. | `nil` |
| `MYSQL_UPGRADE` | Percona Server for MySQL upgrade option. | `AUTO` |
| `MYSQL_IS_DEDICATED_SERVER` | Whether the Percona Server for MySQL Server will run on a dedicated node. | `nil` |
| `MYSQL_CLIENT_ENABLE_SSL` | Whether to force SSL for connections to the Percona Server for MySQL database. | `no` |
| `MYSQL_CLIENT_SSL_CA_FILE` | Path to CA certificate to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_SSL_CERT_FILE` | Path to client public key certificate to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_SSL_KEY_FILE` | Path to client private key to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_EXTRA_FLAGS` | Whether to force SSL connections with the "mysql" CLI tool. Useful for applications that rely on the CLI instead of APIs. | `no` |
| `MYSQL_STARTUP_WAIT_RETRIES` | Number of retries waiting for the database to be running. | `300` |
| `MYSQL_STARTUP_WAIT_SLEEP_TIME` | Sleep time between retries waiting for the database to be running. | `2` |
| `MYSQL_ENABLE_SLOW_QUERY` | Whether to enable slow query logs. | `0` |
| `MYSQL_LONG_QUERY_TIME` | How much time, in seconds, defines a slow query. | `10.0` |
| Name | Description | Default Value |
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `ALLOW_EMPTY_PASSWORD` | Allow Percona Server for MySQL access without any password. | `no` |
| `MYSQL_AUTHENTICATION_PLUGIN` | Percona Server for MySQL authentication plugin to configure during the first initialization. | `nil` |
| `MYSQL_ROOT_USER` | Percona Server for MySQL database root user. | `root` |
| `MYSQL_ROOT_PASSWORD` | Percona Server for MySQL database root user password. | `nil` |
| `MYSQL_USER` | Percona Server for MySQL database user to create during the first initialization. | `nil` |
| `MYSQL_PASSWORD` | Password for the Percona Server for MySQL database user to create during the first initialization. | `nil` |
| `MYSQL_DATABASE` | Percona Server for MySQL database to create during the first initialization. | `nil` |
| `MYSQL_MASTER_HOST` | Address for the Percona Server for MySQL master node. | `nil` |
| `MYSQL_MASTER_PORT_NUMBER` | Port number for the Percona Server for MySQL master node. | `3306` |
| `MYSQL_MASTER_ROOT_USER` | Percona Server for MySQL database root user of the master host. | `root` |
| `MYSQL_MASTER_ROOT_PASSWORD` | Password for the Percona Server for MySQL database root user of the the master host. | `nil` |
| `MYSQL_MASTER_DELAY` | Percona Server for MySQL database replication delay. | `0` |
| `MYSQL_REPLICATION_USER` | Percona Server for MySQL replication database user. | `nil` |
| `MYSQL_REPLICATION_PASSWORD` | Password for the Percona Server for MySQL replication database user. | `nil` |
| `MYSQL_PORT_NUMBER` | Port number to use for the Percona Server for MySQL Server service. | `nil` |
| `MYSQL_REPLICATION_MODE` | Percona Server for MySQL replication mode. | `nil` |
| `MYSQL_REPLICATION_SLAVE_DUMP` | Make a dump on master and update slave Percona Server for MySQL database | `false` |
| `MYSQL_EXTRA_FLAGS` | Extra flags to be passed to start the Percona Server for MySQL Server. | `nil` |
| `MYSQL_INIT_SLEEP_TIME` | Sleep time when waiting for Percona Server for MySQL init configuration operations to finish. | `nil` |
| `MYSQL_CHARACTER_SET` | Percona Server for MySQL collation to use. | `nil` |
| `MYSQL_COLLATE` | Percona Server for MySQL collation to use. | `nil` |
| `MYSQL_BIND_ADDRESS` | Percona Server for MySQL bind address. | `nil` |
| `MYSQL_SQL_MODE` | Percona Server for MySQL Server SQL modes to enable. | `nil` |
| `MYSQL_UPGRADE` | Percona Server for MySQL upgrade option. | `AUTO` |
| `MYSQL_IS_DEDICATED_SERVER` | Whether the Percona Server for MySQL Server will run on a dedicated node. | `nil` |
| `MYSQL_CLIENT_ENABLE_SSL` | Whether to force SSL for connections to the Percona Server for MySQL database. | `no` |
| `MYSQL_REPLICATION_USE_SSL` | Whether to force SSL for Percona Server for MySQL replication. | `$DB_CLIENT_ENABLE_SSL` |
| `MYSQL_CLIENT_SSL_CA_FILE` | Path to CA certificate to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_SSL_CERT_FILE` | Path to client public key certificate to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_SSL_KEY_FILE` | Path to client private key to use for SSL connections to the Percona Server for MySQL database server. | `nil` |
| `MYSQL_CLIENT_EXTRA_FLAGS` | Whether to force SSL connections with the "mysql" CLI tool. Useful for applications that rely on the CLI instead of APIs. | `no` |
| `MYSQL_STARTUP_WAIT_RETRIES` | Number of retries waiting for the database to be running. | `300` |
| `MYSQL_STARTUP_WAIT_SLEEP_TIME` | Sleep time between retries waiting for the database to be running. | `2` |
| `MYSQL_ENABLE_SLOW_QUERY` | Whether to enable slow query logs. | `0` |
| `MYSQL_LONG_QUERY_TIME` | How much time, in seconds, defines a slow query. | `10.0` |
### Read-only environment variables