Skip to content

Commit 36ec971

Browse files
author
Gavin Morris
authored
Mariadb max_packet_allowed variable exposed (#295)
* Mariadb max_packet_allowed - Draft * Draft 2 - max_packet_now has default env but still NOT dynamic. Confd env values ignored * Variable rename and README update per Comment 1 * Renamed confd cnf files with correct uid settings * Remove errant comment * Remove three unneeded files * Remove extra set-max-packet directories and files * Missing toml value fixed * Quotes for perm values removed by mistake
1 parent d619760 commit 36ec971

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

mariadb/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ RUN --mount=type=cache,id=mariadb-apk-${TARGETARCH},sharing=locked,target=/var/c
2323
# base image. Set to 10 minutes just incase it ran on very old or overallocated
2424
# hardware.
2525
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=600000
26+
# Default Mariadb value of 16 MB (bytes)
27+
ENV MYSQL_MAX_ALLOWED_PACKET=16777216
2628

2729
COPY --link rootfs /

mariadb/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ default database connection configuration.
4141
| :------------------- | :------ | :------------------------------------------------------------------------------------ |
4242
| MYSQL_ROOT_PASSWORD | | The database root user password. Defaults to `DB_ROOT_PASSWORD` |
4343
| MYSQL_ROOT_USER | | The database root user (used to create the site database). Defaults to `DB_ROOT_USER` |
44+
| 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/) |
4445

4546
## Logs
4647

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[template]
2+
src = "mariadb-server.cnf.tmpl"
3+
dest = "/etc/my.cnf.d/mariadb-server.cnf"
4+
uid = 0
5+
gid = 0
6+
mode = "0664"
7+
keys = [ "/" ]

mariadb/rootfs/etc/my.cnf.d/mariadb-server.cnf renamed to mariadb/rootfs/etc/confd/templates/mariadb-server.cnf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# this is only for the mysqld standalone daemon
99
[mysqld]
1010
# skip-networking
11-
11+
max_allowed_packet ={{ getenv "MYSQL_MAX_ALLOWED_PACKET" }}
1212
# Galera-related settings
1313
[galera]
1414
# Mandatory settings

0 commit comments

Comments
 (0)