[bitnami/mysql] Release 8.3.0-debian-12-r12 (#67610)
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
parent
5db282fcc6
commit
7f363a7069
|
|
@ -7,11 +7,11 @@ ARG TARGETARCH
|
||||||
|
|
||||||
LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
|
LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
|
||||||
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
|
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
|
||||||
org.opencontainers.image.created="2024-05-13T22:55:37Z" \
|
org.opencontainers.image.created="2024-06-06T11:05:46Z" \
|
||||||
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
|
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
|
||||||
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/mysql/README.md" \
|
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/mysql/README.md" \
|
||||||
org.opencontainers.image.licenses="Apache-2.0" \
|
org.opencontainers.image.licenses="Apache-2.0" \
|
||||||
org.opencontainers.image.ref.name="8.3.0-debian-12-r11" \
|
org.opencontainers.image.ref.name="8.3.0-debian-12-r12" \
|
||||||
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/mysql" \
|
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/mysql" \
|
||||||
org.opencontainers.image.title="mysql" \
|
org.opencontainers.image.title="mysql" \
|
||||||
org.opencontainers.image.vendor="Broadcom, Inc." \
|
org.opencontainers.image.vendor="Broadcom, Inc." \
|
||||||
|
|
@ -28,7 +28,7 @@ SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
|
||||||
RUN install_packages ca-certificates curl gcc-11 libaio1 libcom-err2 libgcc-s1 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libsasl2-2 libssl3 libstdc++6 libtinfo6 libtirpc3 procps psmisc
|
RUN install_packages ca-certificates curl gcc-11 libaio1 libcom-err2 libgcc-s1 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libsasl2-2 libssl3 libstdc++6 libtinfo6 libtirpc3 procps psmisc
|
||||||
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
|
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
|
||||||
COMPONENTS=( \
|
COMPONENTS=( \
|
||||||
"ini-file-1.4.6-13-linux-${OS_ARCH}-debian-12" \
|
"ini-file-1.4.6-14-linux-${OS_ARCH}-debian-12" \
|
||||||
"mysql-8.3.0-3-linux-${OS_ARCH}-debian-12" \
|
"mysql-8.3.0-3-linux-${OS_ARCH}-debian-12" \
|
||||||
) ; \
|
) ; \
|
||||||
for COMPONENT in "${COMPONENTS[@]}"; do \
|
for COMPONENT in "${COMPONENTS[@]}"; do \
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"arch": "amd64",
|
"arch": "amd64",
|
||||||
"distro": "debian-12",
|
"distro": "debian-12",
|
||||||
"type": "NAMI",
|
"type": "NAMI",
|
||||||
"version": "1.4.6-13"
|
"version": "1.4.6-14"
|
||||||
},
|
},
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"arch": "amd64",
|
"arch": "amd64",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
# Load Generic Libraries
|
# Load Generic Libraries
|
||||||
. /opt/bitnami/scripts/liblog.sh
|
. /opt/bitnami/scripts/liblog.sh
|
||||||
|
. /opt/bitnami/scripts/libvalidations.sh
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
|
||||||
|
|
@ -68,7 +69,12 @@ get_machine_ip() {
|
||||||
error "Could not find any IP address associated to hostname ${hostname}"
|
error "Could not find any IP address associated to hostname ${hostname}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${ip_addresses[0]}"
|
# Check if the first IP address is IPv6 to add brackets
|
||||||
|
if validate_ipv6 "${ip_addresses[0]}" ; then
|
||||||
|
echo "[${ip_addresses[0]}]"
|
||||||
|
else
|
||||||
|
echo "${ip_addresses[0]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
########################
|
########################
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ mysql_extra_flags() {
|
||||||
|
|
||||||
if [[ -n "$DB_REPLICATION_MODE" ]]; then
|
if [[ -n "$DB_REPLICATION_MODE" ]]; then
|
||||||
randNumber="$(head /dev/urandom | tr -dc 0-9 | head -c 3 ; echo '')"
|
randNumber="$(head /dev/urandom | tr -dc 0-9 | head -c 3 ; echo '')"
|
||||||
dbExtraFlags+=("--server-id=$randNumber" "--binlog-format=ROW" "--log-bin=mysql-bin" "--sync-binlog=1")
|
dbExtraFlags+=("--server-id=$randNumber" "--log-bin=mysql-bin" "--sync-binlog=1")
|
||||||
if [[ "$DB_REPLICATION_MODE" = "slave" ]]; then
|
if [[ "$DB_REPLICATION_MODE" = "slave" ]]; then
|
||||||
dbExtraFlags+=("--relay-log=mysql-relay-bin" "--log-slave-updates=1" "--read-only=1")
|
dbExtraFlags+=("--relay-log=mysql-relay-bin" "--log-replica-updates=1" "--read-only=1")
|
||||||
elif [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
elif [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
||||||
dbExtraFlags+=("--innodb_flush_log_at_trx_commit=1")
|
dbExtraFlags+=("--innodb_flush_log_at_trx_commit=1")
|
||||||
fi
|
fi
|
||||||
|
|
@ -210,14 +210,15 @@ mysql_exec_initial_dump() {
|
||||||
info "Finish import dump databases"
|
info "Finish import dump databases"
|
||||||
|
|
||||||
mysql_execute "mysql" <<EOF
|
mysql_execute "mysql" <<EOF
|
||||||
CHANGE MASTER TO MASTER_HOST='$DB_MASTER_HOST',
|
CHANGE REPLICATION SOURCE TO SOURCE_HOST='$DB_MASTER_HOST',
|
||||||
MASTER_PORT=$DB_MASTER_PORT_NUMBER,
|
SOURCE_PORT=$DB_MASTER_PORT_NUMBER,
|
||||||
MASTER_USER='$DB_REPLICATION_USER',
|
SOURCE_USER='$DB_REPLICATION_USER',
|
||||||
MASTER_PASSWORD='$DB_REPLICATION_PASSWORD',
|
SOURCE_PASSWORD='$DB_REPLICATION_PASSWORD',
|
||||||
MASTER_DELAY=$DB_MASTER_DELAY,
|
SOURCE_DELAY=$DB_MASTER_DELAY,
|
||||||
MASTER_LOG_FILE='$MYSQL_FILE',
|
SOURCE_LOG_FILE='$MYSQL_FILE',
|
||||||
MASTER_LOG_POS=$MYSQL_POSITION,
|
SOURCE_LOG_POS=$MYSQL_POSITION,
|
||||||
MASTER_CONNECT_RETRY=10;
|
SOURCE_CONNECT_RETRY=10,
|
||||||
|
GET_SOURCE_PUBLIC_KEY=1;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
info "Remove dump file"
|
info "Remove dump file"
|
||||||
|
|
@ -252,12 +253,13 @@ mysql_configure_replication() {
|
||||||
debug "Replication master ready!"
|
debug "Replication master ready!"
|
||||||
debug "Setting the master configuration"
|
debug "Setting the master configuration"
|
||||||
mysql_execute "mysql" <<EOF
|
mysql_execute "mysql" <<EOF
|
||||||
CHANGE MASTER TO MASTER_HOST='$DB_MASTER_HOST',
|
CHANGE REPLICATION SOURCE TO SOURCE_HOST='$DB_MASTER_HOST',
|
||||||
MASTER_PORT=$DB_MASTER_PORT_NUMBER,
|
SOURCE_PORT=$DB_MASTER_PORT_NUMBER,
|
||||||
MASTER_USER='$DB_REPLICATION_USER',
|
SOURCE_USER='$DB_REPLICATION_USER',
|
||||||
MASTER_PASSWORD='$DB_REPLICATION_PASSWORD',
|
SOURCE_PASSWORD='$DB_REPLICATION_PASSWORD',
|
||||||
MASTER_DELAY=$DB_MASTER_DELAY,
|
SOURCE_DELAY=$DB_MASTER_DELAY,
|
||||||
MASTER_CONNECT_RETRY=10;
|
SOURCE_CONNECT_RETRY=10,
|
||||||
|
GET_SOURCE_PUBLIC_KEY=1;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -284,15 +286,10 @@ mysql_ensure_replication_user_exists() {
|
||||||
local -r password="${2:-}"
|
local -r password="${2:-}"
|
||||||
|
|
||||||
debug "Configure replication user credentials"
|
debug "Configure replication user credentials"
|
||||||
if [[ "$DB_FLAVOR" = "mariadb" ]]; then
|
mysql_execute "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <<EOF
|
||||||
mysql_execute "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <<EOF
|
create user '$user'@'%' $([ "$password" != "" ] && echo "identified by \"$password\"");
|
||||||
create or replace user '$user'@'%' $([ "$password" != "" ] && echo "identified by \"$password\"");
|
|
||||||
EOF
|
EOF
|
||||||
else
|
|
||||||
mysql_execute "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <<EOF
|
|
||||||
create user '$user'@'%' $([ "$password" != "" ] && echo "identified with 'mysql_native_password' by \"$password\"");
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
mysql_execute "mysql" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" <<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'@'%' with grant option;
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
@ -363,7 +360,7 @@ EOF
|
||||||
if [[ -z "$DB_REPLICATION_MODE" ]] || [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
if [[ -z "$DB_REPLICATION_MODE" ]] || [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
||||||
if [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
if [[ "$DB_REPLICATION_MODE" = "master" ]]; then
|
||||||
debug "Starting replication"
|
debug "Starting replication"
|
||||||
echo "RESET MASTER;" | debug_execute "$DB_BIN_DIR/mysql" --defaults-file="$DB_CONF_FILE" -N -u root
|
echo "RESET BINARY LOGS AND GTIDS;" | debug_execute "$DB_BIN_DIR/mysql" --defaults-file="$DB_CONF_FILE" -N -u root
|
||||||
fi
|
fi
|
||||||
mysql_ensure_root_user_exists "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" "$DB_AUTHENTICATION_PLUGIN"
|
mysql_ensure_root_user_exists "$DB_ROOT_USER" "$DB_ROOT_PASSWORD" "$DB_AUTHENTICATION_PLUGIN"
|
||||||
mysql_ensure_user_not_exists "" # ensure unknown user does not exist
|
mysql_ensure_user_not_exists "" # ensure unknown user does not exist
|
||||||
|
|
@ -464,8 +461,8 @@ mysql_start_bg() {
|
||||||
# Do not start as root, to avoid permission issues
|
# Do not start as root, to avoid permission issues
|
||||||
am_i_root && flags+=("--user=${DB_DAEMON_USER}")
|
am_i_root && flags+=("--user=${DB_DAEMON_USER}")
|
||||||
|
|
||||||
# The slave should only start in 'run.sh', elseways user credentials would be needed for any connection
|
# The replica should only start in 'run.sh', elseways user credentials would be needed for any connection
|
||||||
flags+=("--skip-slave-start")
|
flags+=("--skip-replica-start")
|
||||||
flags+=("$@")
|
flags+=("$@")
|
||||||
|
|
||||||
is_mysql_running && return
|
is_mysql_running && return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue