diff --git a/bitnami/mysql/8.0/debian-11/Dockerfile b/bitnami/mysql/8.0/debian-11/Dockerfile index 39744aecc5d2..e5984947d3d0 100644 --- a/bitnami/mysql/8.0/debian-11/Dockerfile +++ b/bitnami/mysql/8.0/debian-11/Dockerfile @@ -7,10 +7,10 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2024-02-15T09:44:41Z" \ + org.opencontainers.image.created="2024-02-16T11:06:50Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="8.0.36-debian-11-r18" \ + org.opencontainers.image.ref.name="8.0.36-debian-11-r19" \ org.opencontainers.image.title="mysql" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="8.0.36" diff --git a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql-env.sh b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql-env.sh index 590ff2ef447c..ce52ed3bb508 100644 --- a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql-env.sh +++ b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql-env.sh @@ -81,6 +81,7 @@ export DB_DATA_DIR="${DB_VOLUME_DIR}/data" export DB_BIN_DIR="${DB_BASE_DIR}/bin" export DB_SBIN_DIR="${DB_BASE_DIR}/bin" export DB_CONF_DIR="${DB_BASE_DIR}/conf" +export DB_DEFAULT_CONF_DIR="${DB_BASE_DIR}/conf.default" export DB_LOGS_DIR="${DB_BASE_DIR}/logs" export DB_TMP_DIR="${DB_BASE_DIR}/tmp" export DB_CONF_FILE="${DB_CONF_DIR}/my.cnf" diff --git a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/entrypoint.sh b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/entrypoint.sh index ede7ea743d3b..cb36240aab1d 100755 --- a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/entrypoint.sh +++ b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/entrypoint.sh @@ -18,6 +18,12 @@ set -o pipefail print_welcome_page +# We add the copy from default config in the entrypoint to not break users +# bypassing the setup.sh logic. If the file already exists do not overwrite (in +# case someone mounts a configuration file in /opt/bitnami/mysql/conf) +debug "Copying files from $DB_DEFAULT_CONF_DIR to $DB_CONF_DIR" +cp -nfr "$DB_DEFAULT_CONF_DIR"/. "$DB_CONF_DIR" + if [[ "$1" = "/opt/bitnami/scripts/mysql/run.sh" ]]; then info "** Starting MySQL setup **" /opt/bitnami/scripts/mysql/setup.sh diff --git a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/postunpack.sh b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/postunpack.sh index a5effaedb176..b2952f36fe16 100755 --- a/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/postunpack.sh +++ b/bitnami/mysql/8.0/debian-11/rootfs/opt/bitnami/scripts/mysql/postunpack.sh @@ -21,10 +21,14 @@ info "Configuring default MySQL options" ensure_dir_exists "$DB_CONF_DIR" mysql_create_default_config -for dir in "$DB_TMP_DIR" "$DB_LOGS_DIR" "$DB_CONF_DIR" "${DB_CONF_DIR}/bitnami" "$DB_VOLUME_DIR" "$DB_DATA_DIR" "/.mysqlsh"; do +for dir in "$DB_TMP_DIR" "$DB_LOGS_DIR" "$DB_CONF_DIR" "$DB_DEFAULT_CONF_DIR" "${DB_CONF_DIR}/bitnami" "$DB_VOLUME_DIR" "$DB_DATA_DIR" "/.mysqlsh"; do ensure_dir_exists "$dir" chmod -R g+rwX "$dir" done # Redirect logging to PID 1's stdout file descriptor including database initialization logs ln -sf /proc/1/fd/1 "$DB_LOGS_DIR/mysqld.log" + +# Copy all initially generated configuration files to the default directory +# (this is to avoid breaking when entrypoint is being overridden) +cp -r "${DB_CONF_DIR}/"* "$DB_DEFAULT_CONF_DIR" \ No newline at end of file diff --git a/bitnami/mysql/README.md b/bitnami/mysql/README.md index 37e0f03caf40..8c3d1d5f245b 100644 --- a/bitnami/mysql/README.md +++ b/bitnami/mysql/README.md @@ -196,6 +196,7 @@ docker-compose up -d | `DB_BIN_DIR` | MySQL directory where executable binary files are located. | `${DB_BASE_DIR}/bin` | | `DB_SBIN_DIR` | MySQL directory where service binary files are located. | `${DB_BASE_DIR}/bin` | | `DB_CONF_DIR` | MySQL configuration directory. | `${DB_BASE_DIR}/conf` | +| `DB_DEFAULT_CONF_DIR` | MySQL default configuration directory. | `${DB_BASE_DIR}/conf.default` | | `DB_LOGS_DIR` | MySQL logs directory. | `${DB_BASE_DIR}/logs` | | `DB_TMP_DIR` | MySQL directory for temporary files. | `${DB_BASE_DIR}/tmp` | | `DB_CONF_FILE` | Main MySQL configuration file. | `${DB_CONF_DIR}/my.cnf` |