diff --git a/bitnami/mysql/8.2/debian-11/Dockerfile b/bitnami/mysql/8.2/debian-11/Dockerfile index 136531edde5f..9a783c85671c 100644 --- a/bitnami/mysql/8.2/debian-11/Dockerfile +++ b/bitnami/mysql/8.2/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="2023-12-28T17:24:30Z" \ + org.opencontainers.image.created="2024-01-16T12:21:32Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="8.2.0-debian-11-r2" \ + org.opencontainers.image.ref.name="8.2.0-debian-11-r3" \ org.opencontainers.image.title="mysql" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="8.2.0" @@ -26,8 +26,8 @@ SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"] RUN install_packages ca-certificates curl gcc-10 libaio1 libcom-err2 libgcc-s1 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libsasl2-2 libssl1.1 libstdc++6 libtinfo6 libtirpc3 procps psmisc RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ COMPONENTS=( \ - "ini-file-1.4.6-4-linux-${OS_ARCH}-debian-11" \ - "mysql-8.2.0-0-linux-${OS_ARCH}-debian-11" \ + "ini-file-1.4.6-5-linux-${OS_ARCH}-debian-11" \ + "mysql-8.2.0-1-linux-${OS_ARCH}-debian-11" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ diff --git a/bitnami/mysql/8.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mysql/8.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index 9d99bbaf135c..c78041e61363 100644 --- a/bitnami/mysql/8.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mysql/8.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,12 +3,12 @@ "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "1.4.6-4" + "version": "1.4.6-5" }, "mysql": { "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "8.2.0-0" + "version": "8.2.0-1" } } \ No newline at end of file diff --git a/bitnami/mysql/8.2/debian-11/prebuildfs/usr/sbin/run-script b/bitnami/mysql/8.2/debian-11/prebuildfs/usr/sbin/run-script index b7a5bf1e50bf..4ca0f897277e 100755 --- a/bitnami/mysql/8.2/debian-11/prebuildfs/usr/sbin/run-script +++ b/bitnami/mysql/8.2/debian-11/prebuildfs/usr/sbin/run-script @@ -10,7 +10,7 @@ fi script=$1 exit_code="${2:-96}" -fail_if_not_present="${3:-y}" +fail_if_not_present="${3:-n}" if test -f "$script"; then sh $script diff --git a/bitnami/mysql/8.2/debian-11/rootfs/opt/bitnami/scripts/libmysql.sh b/bitnami/mysql/8.2/debian-11/rootfs/opt/bitnami/scripts/libmysql.sh index ddfea55f4608..bba902411336 100644 --- a/bitnami/mysql/8.2/debian-11/rootfs/opt/bitnami/scripts/libmysql.sh +++ b/bitnami/mysql/8.2/debian-11/rootfs/opt/bitnami/scripts/libmysql.sh @@ -189,51 +189,35 @@ EOF ######################### mysql_exec_initial_dump() { info "MySQL dump master data start..." - mysql -h "$DB_MASTER_HOST" -P "$DB_MASTER_PORT_NUMBER" -u "$DB_MASTER_ROOT_USER" -p"$DB_MASTER_ROOT_PASSWORD" -e 'RESET MASTER;' databases=("mysql") - if [ -n "$DB_DATABASE" ]; then databases+=("$DB_DATABASE") fi - for DB in "${databases[@]}"; do info "Start dump process database $DB" - if [[ $DB = @(information_schema|performance_schema|sys) ]]; then info "Skipping default table $DB to be imported" continue fi - - FILE_LOCATION="$DB_DATA_DIR/dump_$DB.sql" - - mysqldump --verbose -h "$DB_MASTER_HOST" -P "$DB_MASTER_PORT_NUMBER" -u "$DB_MASTER_ROOT_USER" -p"$DB_MASTER_ROOT_PASSWORD" $DB > $FILE_LOCATION - - info "Finish dump database $DB" - - if [ $? -eq 0 ]; then + DUMP_FILE="$DB_DATA_DIR/dump_$DB.sql" + if mysqldump --verbose -h "$DB_MASTER_HOST" -P "$DB_MASTER_PORT_NUMBER" -u "$DB_MASTER_ROOT_USER" -p"$DB_MASTER_ROOT_PASSWORD" "$DB" > "$DUMP_FILE"; then + info "Finish dump database $DB" info "Ensure database exists $DB" - - mysql -u "$DB_MASTER_ROOT_USER" < docker-compose.yml -docker-compose up -d -``` - -**Warning**: These quick setups are only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the [Configuration](#configuration) section for a more secure deployment. - ## Why use Bitnami Images? * Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems. @@ -175,6 +166,48 @@ docker-compose up -d ## Configuration +### Environment variables + +#### Customizable environment variables + +| Name | Description | Default Value | +|---------------------------------|---------------------------------------------------------------------------------------------------------------------------|---------------| +| `ALLOW_EMPTY_PASSWORD` | Allow MySQL access without any password. | `no` | +| `MYSQL_ROOT_USER` | MySQL database root user. | `root` | +| `MYSQL_MASTER_PORT_NUMBER` | Port number for the MySQL master node. | `3306` | +| `MYSQL_MASTER_ROOT_USER` | MySQL database root user of the master host. | `root` | +| `MYSQL_MASTER_DELAY` | MySQL database replication delay. | `0` | +| `MYSQL_REPLICATION_SLAVE_DUMP` | Make a dump on master and update slave MySQL database | `false` | +| `MYSQL_CLIENT_ENABLE_SSL` | Whether to force SSL for connections to the MySQL database. | `no` | +| `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 + +| Name | Description | Value | +|-------------------------------|------------------------------------------------------------|-------------------------------| +| `DB_FLAVOR` | SQL database flavor. Valid values: `mariadb` or `mysql`. | `mysql` | +| `DB_BASE_DIR` | Base path for MySQL files. | `${BITNAMI_ROOT_DIR}/mysql` | +| `DB_VOLUME_DIR` | MySQL directory for persisted files. | `${BITNAMI_VOLUME_DIR}/mysql` | +| `DB_DATA_DIR` | MySQL directory for data files. | `${DB_VOLUME_DIR}/data` | +| `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_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` | +| `DB_PID_FILE` | MySQL PID file. | `${DB_TMP_DIR}/mysqld.pid` | +| `DB_SOCKET_FILE` | MySQL Server socket file. | `${DB_TMP_DIR}/mysql.sock` | +| `DB_DAEMON_USER` | Users that will execute the MySQL Server process. | `mysql` | +| `DB_DAEMON_GROUP` | Group that will execute the MySQL Server process. | `mysql` | +| `MYSQL_DEFAULT_PORT_NUMBER` | Default port number to use for the MySQL Server service. | `3306` | +| `MYSQL_DEFAULT_CHARACTER_SET` | Default MySQL character set. | `utf8mb4` | +| `MYSQL_DEFAULT_BIND_ADDRESS` | Default MySQL bind address. | `0.0.0.0` | +| `MYSQL_DISABLE_SERVICE` | Whether to disable the MySQL service by default. | `no` | + ### Initializing a new instance The container can execute custom files on the first start and on every start. Files with extensions `.sh`, `.sql` and `.sql.gz` are supported. @@ -664,6 +697,12 @@ $ docker-compose up -d * `ALLOW_EMPTY_PASSWORD` has been added to the available env variables. It can be used to allow blank passwords for MySQL. * By default the MySQL image requires a root password to start. You can specify it using the `MYSQL_ROOT_PASSWORD` env variable or disable this requirement by setting the `ALLOW_EMPTY_PASSWORD` env variable to `yes` (testing or development scenarios). +## Using `docker-compose.yaml` + +Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/mysql). + +If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md). + ## Contributing We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/containers/issues) or submitting a [pull request](https://github.com/bitnami/containers/pulls) with your contribution.