5.7.27-ol-7-r26 release

This commit is contained in:
Bitnami Bot 2019-08-14 15:09:34 +00:00
parent a18e9089ce
commit 9bf16b61f6
3 changed files with 35 additions and 18 deletions

View File

@ -9,14 +9,14 @@ ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
# Install required system packages and dependencies
RUN install_packages cyrus-sasl-lib glibc keyutils-libs krb5-libs libaio libcom_err libgcc libselinux libstdc++ ncurses-libs nss-softokn-freebl pcre
RUN . ./libcomponent.sh && component_unpack "mysql" "5.7.27-0" --checksum 7c0aec313965b318256c723fc4bedc76cc7f585813903259becdc39da944ed63
RUN . ./libcomponent.sh && component_unpack "mysql" "5.7.27-1" --checksum 814a109993bbf8c84cef3c1f3e4104d5f7f9f01ecd596b38e494f7e2b9dfce51
RUN mkdir /docker-entrypoint-initdb.d
COPY rootfs /
RUN /postunpack.sh
ENV ALLOW_EMPTY_PASSWORD="no" \
BITNAMI_APP_NAME="mysql" \
BITNAMI_IMAGE_VERSION="5.7.27-ol-7-r25" \
BITNAMI_IMAGE_VERSION="5.7.27-ol-7-r26" \
MYSQL_DATABASE="" \
MYSQL_MASTER_HOST="" \
MYSQL_MASTER_PORT_NUMBER="" \

View File

@ -64,6 +64,21 @@ get_env_var_value() {
echo "${!envVar:-}"
}
########################
# Gets an environment variable value for the master node and based on the suffix
# Arguments:
# $1 - environment variable suffix
# Returns:
# environment variable value
#########################
get_master_env_var_value() {
local envVar
PREFIX=""
[[ "$DB_REPLICATION_MODE" = "slave" ]] && PREFIX="MASTER_"
envVar="$(get_env_var "$PREFIX$1")"
echo "${!envVar:-}"
}
########################
# Execute an arbitrary query/queries against the running MySQL/MariaDB service
# Stdin:
@ -168,8 +183,8 @@ mysql_start_bg() {
fi
# wait until the server is up and answering queries.
local args=(mysql root)
is_boolean_yes "${ROOT_AUTH_ENABLED:-false}" && args+=("$DB_ROOT_PASSWORD")
local args=("mysql" "root")
is_boolean_yes "${ROOT_AUTH_ENABLED:-false}" && args+=("$(get_master_env_var_value ROOT_PASSWORD)")
while ! echo "select 1" | mysql_execute "${args[@]}"; do
sleep 1
done
@ -477,17 +492,17 @@ mysql_upgrade() {
debug "Running mysql_upgrade..."
if [[ "$DB_FLAVOR" = "mysql" ]] && [[ "$major_version" = "5" ]]; then
args+=("--force")
fi
if [[ "$DB_FLAVOR" = "mysql" ]] && [[ "$major_version" = "8" ]]; then
if [[ "$DB_FLAVOR" = "mysql" ]] && [[ "$major_version" -ge "8" ]]; then
mysql_stop
export DB_FORCE_UPGRADE=true
mysql_start_bg
unset DB_FORCE_UPGRADE
else
if is_boolean_yes "${ROOT_AUTH_ENABLED:-false}"; then
args+=("-p$DB_ROOT_PASSWORD")
if [[ "$DB_FLAVOR" = "mysql" ]]; then
args+=("--force")
fi
if [[ -z "$DB_REPLICATION_MODE" ]] || [[ "$DB_REPLICATION_MODE" = "master" ]]; then
is_boolean_yes "${ROOT_AUTH_ENABLED:-false}" && args+=("-p$(get_master_env_var_value ROOT_PASSWORD)")
fi
if [[ "${BITNAMI_DEBUG:-false}" = true ]]; then
"${DB_BINDIR}/mysql_upgrade" "${args[@]}"
@ -602,7 +617,6 @@ mysql_ensure_root_user_exists() {
local password="${2:-}"
debug "Configuring root user credentials..."
[[ -n "$password" ]] && export ROOT_AUTH_ENABLED="yes"
if [ "$DB_FLAVOR" == "mariadb" ]; then
mysql_execute "mysql" "root" <<EOF
-- create root@localhost user for local admin access
@ -728,11 +742,13 @@ mysql_initialize() {
if [[ -e "$DB_DATADIR/mysql" ]]; then
info "Persisted data detected. Restoring..."
# if MYSQL/MARIADB_ROOT_PASSWORD is set, enable auth
[[ -n "$(get_env_var ROOT_PASSWORD)" ]] && export ROOT_AUTH_ENABLED="yes"
info "Running mysql_upgrade..."
mysql_start_bg
mysql_upgrade
if [[ "$DB_FLAVOR" = "mysql" ]]; then
# if MYSQL/MARIADB_ROOT_PASSWORD is set, enable auth
[[ -n "$(get_master_env_var_value ROOT_PASSWORD)" ]] && export ROOT_AUTH_ENABLED="yes"
info "Running mysql_upgrade..."
mysql_start_bg
mysql_upgrade
fi
else
debug "Cleaning data directory to ensure successfully initialization..."
rm -rf "${DB_DATADIR:?}"/*
@ -744,7 +760,7 @@ DELETE FROM mysql.user WHERE user<>'mysql.sys';
EOF
# slaves do not need to configure users
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..."
if [[ "${BITNAMI_DEBUG:-false}" = true ]]; then
echo "RESET MASTER;" | "$DB_BINDIR/mysql" --defaults-file="$DB_CONFDIR/my.cnf" -N -u root
@ -756,6 +772,7 @@ EOF
mysql_ensure_user_not_exists "" # ensure unknown user does not exist
mysql_ensure_optional_database_exists "$DB_DATABASE" "$DB_USER" "$DB_PASSWORD"
fi
[[ -n "$(get_master_env_var_value ROOT_PASSWORD)" ]] && export ROOT_AUTH_ENABLED="yes"
# configure replication mode
[[ -n "$DB_REPLICATION_MODE" ]] && mysql_configure_replication
if [[ "$DB_FLAVOR" = "mysql" ]]; then

View File

@ -48,7 +48,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
* [`8.0-ol-7`, `8.0.17-ol-7-r17` (8.0/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-mysql/blob/8.0.17-ol-7-r17/8.0/ol-7/Dockerfile)
* [`8.0-debian-9`, `8.0.17-debian-9-r17`, `8.0`, `8.0.17`, `8.0.17-r17`, `latest` (8.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mysql/blob/8.0.17-debian-9-r17/8.0/debian-9/Dockerfile)
* [`5.7-ol-7`, `5.7.27-ol-7-r24` (5.7/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-mysql/blob/5.7.27-ol-7-r24/5.7/ol-7/Dockerfile)
* [`5.7-ol-7`, `5.7.27-ol-7-r26` (5.7/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-mysql/blob/5.7.27-ol-7-r26/5.7/ol-7/Dockerfile)
* [`5.7-debian-9`, `5.7.27-debian-9-r25`, `5.7`, `5.7.27`, `5.7.27-r25` (5.7/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mysql/blob/5.7.27-debian-9-r25/5.7/debian-9/Dockerfile)
Subscribe to project updates by watching the [bitnami/mysql GitHub repo](https://github.com/bitnami/bitnami-docker-mysql).