diff --git a/bitnami/mariadb/11.2/debian-11/Dockerfile b/bitnami/mariadb/11.2/debian-11/Dockerfile index 2dc029e4ed42..74d3db44a939 100644 --- a/bitnami/mariadb/11.2/debian-11/Dockerfile +++ b/bitnami/mariadb/11.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-20T08:29:43Z" \ + org.opencontainers.image.created="2024-01-16T14:50:05Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="11.2.2-debian-11-r1" \ + org.opencontainers.image.ref.name="11.2.2-debian-11-r2" \ org.opencontainers.image.title="mariadb" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="11.2.2" @@ -26,7 +26,7 @@ SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"] RUN install_packages ca-certificates curl libaio1 libaudit1 libcap-ng0 libcrypt1 libgcc-s1 libicu67 liblzma5 libncurses6 libpam0g libssl1.1 libstdc++6 libtinfo6 libxml2 procps psmisc zlib1g RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ COMPONENTS=( \ - "ini-file-1.4.6-4-linux-${OS_ARCH}-debian-11" \ + "ini-file-1.4.6-5-linux-${OS_ARCH}-debian-11" \ "mariadb-11.2.2-0-linux-${OS_ARCH}-debian-11" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ diff --git a/bitnami/mariadb/11.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/mariadb/11.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json index 5bc624169bf8..1db60ce677ed 100644 --- a/bitnami/mariadb/11.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/mariadb/11.2/debian-11/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,7 +3,7 @@ "arch": "amd64", "distro": "debian-11", "type": "NAMI", - "version": "1.4.6-4" + "version": "1.4.6-5" }, "mariadb": { "arch": "amd64", diff --git a/bitnami/mariadb/11.2/debian-11/prebuildfs/usr/sbin/run-script b/bitnami/mariadb/11.2/debian-11/prebuildfs/usr/sbin/run-script index b7a5bf1e50bf..4ca0f897277e 100755 --- a/bitnami/mariadb/11.2/debian-11/prebuildfs/usr/sbin/run-script +++ b/bitnami/mariadb/11.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/mariadb/11.2/debian-11/rootfs/opt/bitnami/scripts/libmariadb.sh b/bitnami/mariadb/11.2/debian-11/rootfs/opt/bitnami/scripts/libmariadb.sh index 192984bec0a0..bba902411336 100644 --- a/bitnami/mariadb/11.2/debian-11/rootfs/opt/bitnami/scripts/libmariadb.sh +++ b/bitnami/mariadb/11.2/debian-11/rootfs/opt/bitnami/scripts/libmariadb.sh @@ -178,6 +178,49 @@ pid_file=${DB_PID_FILE} EOF } +######################## +# Make a dump on master database and update slave database +# Globals: +# DB_* +# Arguments: +# None +# Returns: +# None +######################### +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 + 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? @@ -175,6 +168,48 @@ docker-compose up -d ## Configuration +### Environment variables + +#### Customizable environment variables + +| Name | Description | Default Value | +|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------|---------------| +| `ALLOW_EMPTY_PASSWORD` | Allow MariaDB access without any password. | `no` | +| `MARIADB_ROOT_USER` | MariaDB database root user. | `root` | +| `MARIADB_MASTER_PORT_NUMBER` | Port number for the MariaDB master node. | `3306` | +| `MARIADB_MASTER_ROOT_USER` | MariaDB database root user of the master host. | `root` | +| `MARIADB_MASTER_DELAY` | MariaDB database replication delay. | `0` | +| `MARIADB_SKIP_TEST_DB` | Whether to skip creating the test database. | `no` | +| `MARIADB_CLIENT_ENABLE_SSL` | Whether to force SSL for connections to the MariaDB database. | `no` | +| `MARIADB_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` | +| `MARIADB_STARTUP_WAIT_RETRIES` | Number of retries waiting for the database to be running. | `300` | +| `MARIADB_STARTUP_WAIT_SLEEP_TIME` | Sleep time between retries waiting for the database to be running. | `2` | +| `MARIADB_ENABLE_SLOW_QUERY` | Whether to enable slow query logs. | `0` | +| `MARIADB_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`. | `mariadb` | +| `DB_BASE_DIR` | Base path for MariaDB files. | `${BITNAMI_ROOT_DIR}/mariadb` | +| `DB_VOLUME_DIR` | MariaDB directory for persisted files. | `${BITNAMI_VOLUME_DIR}/mariadb` | +| `DB_DATA_DIR` | MariaDB directory for data files. | `${DB_VOLUME_DIR}/data` | +| `DB_BIN_DIR` | MariaDB directory where executable binary files are located. | `${DB_BASE_DIR}/bin` | +| `DB_SBIN_DIR` | MariaDB directory where service binary files are located. | `${DB_BASE_DIR}/sbin` | +| `DB_CONF_DIR` | MariaDB configuration directory. | `${DB_BASE_DIR}/conf` | +| `DB_LOGS_DIR` | MariaDB logs directory. | `${DB_BASE_DIR}/logs` | +| `DB_TMP_DIR` | MariaDB directory for temporary files. | `${DB_BASE_DIR}/tmp` | +| `DB_CONF_FILE` | Main MariaDB configuration file. | `${DB_CONF_DIR}/my.cnf` | +| `DB_PID_FILE` | MariaDB PID file. | `${DB_TMP_DIR}/mysqld.pid` | +| `DB_SOCKET_FILE` | MariaDB Server socket file. | `${DB_TMP_DIR}/mysql.sock` | +| `DB_DAEMON_USER` | Users that will execute the MariaDB Server process. | `mysql` | +| `DB_DAEMON_GROUP` | Group that will execute the MariaDB Server process. | `mysql` | +| `MARIADB_DEFAULT_PORT_NUMBER` | Default port number to use for the MariaDB Server service. | `3306` | +| `MARIADB_DEFAULT_CHARACTER_SET` | Default MariaDB character set. | `utf8mb4` | +| `MARIADB_DEFAULT_BIND_ADDRESS` | Default MariaDB bind address. | `0.0.0.0` | +| `MARIADB_DISABLE_SERVICE` | Whether to disable the MariaDB service by default. | `no` | + ### Initializing a new instance When the container is executed for the first time, it will execute the files with extensions `.sh`, `.sql` and `.sql.gz` located at `/docker-entrypoint-startdb.d`. @@ -729,6 +764,12 @@ $ docker-compose up -d * All volumes have been merged at `/bitnami/mariadb`. Now you only need to mount a single volume at `/bitnami/mariadb` for persistence. * The logs are always sent to the `stdout` and are no longer collected in the volume. +## 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/mariadb). + +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.