Skip to content

Commit fcb1ed4

Browse files
authored
Merge pull request #170 from linuxserver/3.23
Rebase to 3.23, enable cli opt passthrough
2 parents 1daca62 + 480f44d commit fcb1ed4

10 files changed

Lines changed: 18 additions & 20 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of master branch. To disable this trigger, add \`mariadb_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
32+
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
3333
&& awk '/^P:'"mariadb"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
3434
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
3535
if grep -q "^mariadb_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
@@ -107,7 +107,7 @@ jobs:
107107
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
108108
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
109109
exit 0
110-
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"mariadb"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
110+
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"mariadb"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
111111
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
112112
FAILURE_REASON="New version ${EXT_RELEASE} for mariadb tag latest is detected, however not all arch repos are updated yet. Will try again later."
113113
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:3.22
3+
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
44

55
# set version label
66
ARG BUILD_DATE
@@ -16,7 +16,7 @@ ENV DATADIR="$MYSQL_DIR/databases"
1616
RUN \
1717
echo "**** install runtime packages ****" && \
1818
if [ -z ${MARIADB_VERSION+x} ]; then \
19-
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
19+
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
2020
&& awk '/^P:mariadb$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
2121
fi && \
2222
apk add --no-cache \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.22
3+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.23
44

55
# set version label
66
ARG BUILD_DATE
@@ -16,7 +16,7 @@ ENV DATADIR="$MYSQL_DIR/databases"
1616
RUN \
1717
echo "**** install runtime packages ****" && \
1818
if [ -z ${MARIADB_VERSION+x} ]; then \
19-
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
19+
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
2020
&& awk '/^P:mariadb$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
2121
fi && \
2222
apk add --no-cache \

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pipeline {
2727
DEV_DOCKERHUB_IMAGE = 'lsiodev/mariadb'
2828
PR_DOCKERHUB_IMAGE = 'lspipepr/mariadb'
2929
DIST_IMAGE = 'alpine'
30-
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main/'
30+
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.23/main/'
3131
DIST_REPO_PACKAGES = 'mariadb'
3232
MULTIARCH='true'
3333
CI='true'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ services:
154154
- MYSQL_USER=MYSQL_USER #optional
155155
- MYSQL_PASSWORD=DATABASE_PASSWORD #optional
156156
- REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql #optional
157+
- CLI_OPTS= #optional
157158
volumes:
158159
- /path/to/mariadb/config:/config
159160
ports:
@@ -174,6 +175,7 @@ docker run -d \
174175
-e MYSQL_USER=MYSQL_USER `#optional` \
175176
-e MYSQL_PASSWORD=DATABASE_PASSWORD `#optional` \
176177
-e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql `#optional` \
178+
-e CLI_OPTS= `#optional` \
177179
-p 3306:3306 \
178180
-v /path/to/mariadb/config:/config \
179181
--restart unless-stopped \
@@ -195,6 +197,7 @@ Containers are configured using parameters passed at runtime (such as those abov
195197
| `-e MYSQL_USER=MYSQL_USER` | This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here). (valid only for first run) |
196198
| `-e MYSQL_PASSWORD=DATABASE_PASSWORD` | Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped). (valid only for first run) |
197199
| `-e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql` | Set this to ingest sql files from an http/https endpoint (comma seperated array). |
200+
| `-e CLI_OPTS=` | Pass CLI options to mariadbd via mariadbd-safe. Use with caution as mariadbd option precedence is complex. |
198201
| `-v /config` | Persistent config files |
199202
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
200203
| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). |
@@ -361,6 +364,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
361364

362365
## Versions
363366

367+
* **14.02.25:** - Rebase to Alpine 3.23. Add ability to pass CLI options to mariadbd.
364368
* **09.07.25:** - Rebase to Alpine 3.22.
365369
* **11.01.25:** - Add log rotation, follow the instructions in the container log.
366370
* **06.01.25:** - Rebase to Alpine 3.21.

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repo_vars:
1515
- DEV_DOCKERHUB_IMAGE = 'lsiodev/mariadb'
1616
- PR_DOCKERHUB_IMAGE = 'lspipepr/mariadb'
1717
- DIST_IMAGE = 'alpine'
18-
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main/'
18+
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.23/main/'
1919
- DIST_REPO_PACKAGES = 'mariadb'
2020
- MULTIARCH='true'
2121
- CI='true'

readme-vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ opt_param_env_vars:
3030
- {env_var: "MYSQL_USER", env_value: "MYSQL_USER", desc: "This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here). (valid only for first run)"}
3131
- {env_var: "MYSQL_PASSWORD", env_value: "DATABASE_PASSWORD", desc: "Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped). (valid only for first run)"}
3232
- {env_var: "REMOTE_SQL", env_value: "http://URL1/your.sql,https://URL2/your.sql", desc: "Set this to ingest sql files from an http/https endpoint (comma seperated array)."}
33+
- {env_var: "CLI_OPTS", env_value: "", desc: "Pass CLI options to mariadbd via mariadbd-safe. Use with caution as mariadbd option precedence is complex."}
3334
readonly_supported: true
3435
readonly_message: |
3536
* `/tmp` must be mounted to tmpfs
@@ -143,6 +144,7 @@ init_diagram: |
143144
"mariadb:latest" <- Base Images
144145
# changelog
145146
changelogs:
147+
- {date: "14.02.25:", desc: "Rebase to Alpine 3.23. Add ability to pass CLI options to mariadbd."}
146148
- {date: "09.07.25:", desc: "Rebase to Alpine 3.22."}
147149
- {date: "11.01.25:", desc: "Add log rotation, follow the instructions in the container log."}
148150
- {date: "06.01.25:", desc: "Rebase to Alpine 3.21."}

root/defaults/custom.cnf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ log_bin_index = /config/log/mysql/mariadb-bin.index
129129
expire_logs_days = 10
130130
max_binlog_size = 100M
131131
# slaves
132+
# If not set in a single server environment binary logs will never be discarded - https://jira.mariadb.org/browse/MDEV-34504
133+
slave_connections_needed_for_purge = 0
132134
#relay_log = /config/log/mysql/relay-bin
133135
#relay_log_index = /config/log/mysql/relay-bin.index
134136
#relay_log_info_file = /config/log/mysql/relay-bin.info

root/etc/s6-overlay/s6-rc.d/svc-mariadb/finish

Lines changed: 0 additions & 6 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/svc-mariadb/run

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
99
--datadir="${DATADIR}" \
1010
--pid-file=/run/mysqld/mysqld.pid \
1111
--skip-networking=OFF \
12-
--user=abc &
13-
14-
wait
12+
--user=abc ${CLI_OPTS}
1513
else
1614
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 3306" \
1715
/usr/bin/mariadbd-safe \
1816
--defaults-extra-file=/config/custom.cnf \
1917
--datadir="${DATADIR}" \
2018
--pid-file=/run/mysqld/mysqld.pid \
21-
--skip-networking=OFF &
22-
23-
wait
19+
--skip-networking=OFF ${CLI_OPTS}
2420
fi

0 commit comments

Comments
 (0)