diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile index 7b670c2b..c2ae9ac7 100644 --- a/mariadb/Dockerfile +++ b/mariadb/Dockerfile @@ -24,4 +24,6 @@ RUN --mount=type=cache,id=mariadb-apk-${TARGETARCH},sharing=locked,target=/var/c # hardware. ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=600000 +ENV MYSQL_MAX_ALLOWED_PACKET=16777216 + COPY --link rootfs / diff --git a/mariadb/README.md b/mariadb/README.md index 1937280e..87c088d0 100644 --- a/mariadb/README.md +++ b/mariadb/README.md @@ -37,10 +37,11 @@ Requires `islandora/base` docker image to build. Please refer to the Please see the documentation in the [base image] for more information about the default database connection configuration. -| Environment Variable | Default | Description | -| :------------------- | :------ | :------------------------------------------------------------------------------------ | -| MYSQL_ROOT_PASSWORD | | The database root user password. Defaults to `DB_ROOT_PASSWORD` | -| MYSQL_ROOT_USER | | The database root user (used to create the site database). Defaults to `DB_ROOT_USER` | +| Environment Variable | Default | Description | +| :----------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| MYSQL_ROOT_PASSWORD | | The database root user password. Defaults to `DB_ROOT_PASSWORD` | +| MYSQL_ROOT_USER | | The database root user (used to create the site database). Defaults to `DB_ROOT_USER` | +| MYSQL_MAX_ALLOWED_PACKET | 16777216 | Max packet length to send to or receive from the server, [documentation](https://mariadb.com/docs/server/ref/mdb/system-variables/max_allowed_packet/) | ## Logs diff --git a/mariadb/rootfs/etc/confd/conf.d/mariadb-server.toml b/mariadb/rootfs/etc/confd/conf.d/mariadb-server.toml new file mode 100644 index 00000000..7b5a8c2b --- /dev/null +++ b/mariadb/rootfs/etc/confd/conf.d/mariadb-server.toml @@ -0,0 +1,7 @@ +[template] +src = "mariadb-server.cnf.tmpl" +dest = "/etc/my.cnf.d/mariadb-server.cnf" +uid = 0 +gid = 0 +mode = "0644" +keys = [ "/" ] diff --git a/mariadb/rootfs/etc/my.cnf.d/mariadb-server.cnf b/mariadb/rootfs/etc/confd/templates/mariadb-server.cnf.tmpl similarity index 85% rename from mariadb/rootfs/etc/my.cnf.d/mariadb-server.cnf rename to mariadb/rootfs/etc/confd/templates/mariadb-server.cnf.tmpl index 77569381..7bda9905 100644 --- a/mariadb/rootfs/etc/my.cnf.d/mariadb-server.cnf +++ b/mariadb/rootfs/etc/confd/templates/mariadb-server.cnf.tmpl @@ -9,6 +9,9 @@ [mysqld] # skip-networking +# Allow for max_allowed_packet. +max_allowed_packet={{ getenv "MYSQL_MAX_ALLOWED_PACKET" }} + # Galera-related settings [galera] # Mandatory settings @@ -35,7 +38,7 @@ # you can put MariaDB-only options here [mariadb] -# This group is only read by MariaDB-10.3 servers. +# This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand -[mariadb-10.3] +[mariadb-10.5]