Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
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
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:'"mariadb"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
if grep -q "^mariadb_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
exit 0
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
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
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
FAILURE_REASON="New version ${EXT_RELEASE} for mariadb tag latest is detected, however not all arch repos are updated yet. Will try again later."
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

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

# set version label
ARG BUILD_DATE
Expand All @@ -16,7 +16,7 @@ ENV DATADIR="$MYSQL_DIR/databases"
RUN \
echo "**** install runtime packages ****" && \
if [ -z ${MARIADB_VERSION+x} ]; then \
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:mariadb$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

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

# set version label
ARG BUILD_DATE
Expand All @@ -16,7 +16,7 @@ ENV DATADIR="$MYSQL_DIR/databases"
RUN \
echo "**** install runtime packages ****" && \
if [ -z ${MARIADB_VERSION+x} ]; then \
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:mariadb$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
DEV_DOCKERHUB_IMAGE = 'lsiodev/mariadb'
PR_DOCKERHUB_IMAGE = 'lspipepr/mariadb'
DIST_IMAGE = 'alpine'
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main/'
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.23/main/'
DIST_REPO_PACKAGES = 'mariadb'
MULTIARCH='true'
CI='true'
Expand Down Expand Up @@ -286,7 +286,7 @@ pipeline {
-v ${WORKSPACE}:/mnt \
-e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \
-e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \
ghcr.io/linuxserver/baseimage-alpine:3 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
ghcr.io/linuxserver/baseimage-alpine:3.23 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\
apk add --no-cache python3 && \
python3 -m venv /lsiopy && \
pip install --no-cache-dir -U pip && \
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ This image can be run with a non-root user. For details please [read the docs](h
To help you get started creating a container from this image you can either use docker-compose or the docker cli.

>[!NOTE]
>Unless a parameter is flaged as 'optional', it is *mandatory* and a value must be provided.
>Unless a parameter is flagged as 'optional', it is *mandatory* and a value must be provided.

### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose))

Expand All @@ -154,6 +154,7 @@ services:
- MYSQL_USER=MYSQL_USER #optional
- MYSQL_PASSWORD=DATABASE_PASSWORD #optional
- REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql #optional
- CLI_OPTS= #optional
volumes:
- /path/to/mariadb/config:/config
ports:
Expand All @@ -174,6 +175,7 @@ docker run -d \
-e MYSQL_USER=MYSQL_USER `#optional` \
-e MYSQL_PASSWORD=DATABASE_PASSWORD `#optional` \
-e REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql `#optional` \
-e CLI_OPTS= `#optional` \
-p 3306:3306 \
-v /path/to/mariadb/config:/config \
--restart unless-stopped \
Expand All @@ -195,6 +197,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-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) |
| `-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) |
| `-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). |
| `-e CLI_OPTS=` | Pass CLI options to mariadbd via mariadbd-safe. Use with caution as mariadbd option precedence is complex. |
| `-v /config` | Persistent config files |
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). |
Expand Down Expand Up @@ -361,6 +364,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **14.02.25:** - Rebase to Alpine 3.23. Add ability to pass CLI options to mariadbd.
* **09.07.25:** - Rebase to Alpine 3.22.
* **11.01.25:** - Add log rotation, follow the instructions in the container log.
* **06.01.25:** - Rebase to Alpine 3.21.
Expand Down
2 changes: 1 addition & 1 deletion jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repo_vars:
- DEV_DOCKERHUB_IMAGE = 'lsiodev/mariadb'
- PR_DOCKERHUB_IMAGE = 'lspipepr/mariadb'
- DIST_IMAGE = 'alpine'
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main/'
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.23/main/'
- DIST_REPO_PACKAGES = 'mariadb'
- MULTIARCH='true'
- CI='true'
Expand Down
2 changes: 2 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ opt_param_env_vars:
- {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)"}
- {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)"}
- {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)."}
- {env_var: "CLI_OPTS", env_value: "", desc: "Pass CLI options to mariadbd via mariadbd-safe. Use with caution as mariadbd option precedence is complex."}
readonly_supported: true
readonly_message: |
* `/tmp` must be mounted to tmpfs
Expand Down Expand Up @@ -143,6 +144,7 @@ init_diagram: |
"mariadb:latest" <- Base Images
# changelog
changelogs:
- {date: "14.02.25:", desc: "Rebase to Alpine 3.23. Add ability to pass CLI options to mariadbd."}
- {date: "09.07.25:", desc: "Rebase to Alpine 3.22."}
- {date: "11.01.25:", desc: "Add log rotation, follow the instructions in the container log."}
- {date: "06.01.25:", desc: "Rebase to Alpine 3.21."}
Expand Down
2 changes: 2 additions & 0 deletions root/defaults/custom.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ log_bin_index = /config/log/mysql/mariadb-bin.index
expire_logs_days = 10
max_binlog_size = 100M
# slaves
# If not set in a single server environment binary logs will never be discarded - https://jira.mariadb.org/browse/MDEV-34504
slave_connections_needed_for_purge = 0
#relay_log = /config/log/mysql/relay-bin
#relay_log_index = /config/log/mysql/relay-bin.index
#relay_log_info_file = /config/log/mysql/relay-bin.info
Expand Down
6 changes: 0 additions & 6 deletions root/etc/s6-overlay/s6-rc.d/svc-mariadb/finish

This file was deleted.

8 changes: 2 additions & 6 deletions root/etc/s6-overlay/s6-rc.d/svc-mariadb/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
--datadir="${DATADIR}" \
--pid-file=/run/mysqld/mysqld.pid \
--skip-networking=OFF \
--user=abc &

wait
--user=abc ${CLI_OPTS}
else
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 3306" \
/usr/bin/mariadbd-safe \
--defaults-extra-file=/config/custom.cnf \
--datadir="${DATADIR}" \
--pid-file=/run/mysqld/mysqld.pid \
--skip-networking=OFF &

wait
--skip-networking=OFF ${CLI_OPTS}
fi