Hardened MariaDB 11.8 & 12.3 LTS on Debian 13 (trixie) with daily CVE-gated builds.
5.3K
Hardened, multi-arch, rootless MariaDB 11.8 LTS and MariaDB 12.3 LTS container images on Debian 13 (trixie-slim), installing server packages from the official GPG-verified MariaDB Debian 13 APT repository and rebuilding gosu from source with the latest patched Go toolchain, maintained by Daniel G. Cosenza from FNX Labs.
dgcosenza/mariadbghcr.io/dgcosenza/mariadb (identical signed multi-arch digests)dgcosenza/mariadb-dockerMariaDB/server (GPL-2.0-only)Last verified build: 2026-11-28 (UTC) — multi-arch (linux/amd64, linux/arm64), Cosign OIDC signed, SPDX & CycloneDX SBOM attested, SLSA Build L3 provenance.
| Track | Upstream Version | Base OS | Step-down Helper | Uncompressed Size | Fixable findings of any severity (Trivy + Grype SBOM) |
|---|---|---|---|---|---|
11.8 (LTS) | 11.8.10 | Debian 13.8 | gosu 1.20 (Go 1.27.4) | amd64: 129.0 MB, arm64: 455.8 MB | 0 (18 unfixed) |
12.3 (LTS) | 12.3.4 | Debian 13.8 | gosu 1.20 (Go 1.27.4) | amd64: 130.5 MB, arm64: 460.6 MB | 0 (18 unfixed) |
Published multi-arch digests (identical on Docker Hub & GHCR):
11.8 (11.8.10): dgcosenza/mariadb@sha256:fd0339233400d457518b551e84cca6685c71988679896f37ac64a5687f00fa51 / ghcr.io/dgcosenza/mariadb@sha256:fd0339233400d457518b551e84cca6685c71988679896f37ac64a5687f00fa5112.3 (12.3.4): dgcosenza/mariadb@sha256:46ff6853bedc588e6c0946b134533cce0178e12160d4efb80163be2157430963 / ghcr.io/dgcosenza/mariadb@sha256:46ff6853bedc588e6c0946b134533cce0178e12160d4efb80163be2157430963Identical multi-arch OCI digests are published to Docker Hub (dgcosenza/mariadb) and GHCR (ghcr.io/dgcosenza/mariadb), accompanied by an automated signed GitHub Release:
| Tag Pattern | Track | Policy | Notes |
|---|---|---|---|
11.8.x-<YYYYMMDD>, 11.8-sha-<short> | MariaDB 11.8 LTS | Immutable | Date- and commit-pinned daily 11.8 LTS builds |
11.8, latest-11.8, 11.8.x | MariaDB 11.8 LTS | Moving | Latest verified daily 11.8 LTS build |
12.3.x-<YYYYMMDD>, 12.3-sha-<short>, sha-<short> | MariaDB 12.3 LTS | Immutable | Date- and commit-pinned daily 12.3 LTS builds |
latest, 12.3, latest-12.3, 12.3.x | MariaDB 12.3 LTS | Moving | Latest verified daily 12.3 LTS build |
Production pinning: Always pin an explicit series tag and immutable digest (@sha256:...) matching your on-disk database series:
image: dgcosenza/mariadb:11.8@sha256:<digest>
# or via GitHub Container Registry (identical digest):
image: ghcr.io/dgcosenza/mariadb:12.3@sha256:<digest>
| Architecture | Status | Verification |
|---|---|---|
linux/amd64 | Published & natively tested | Both 11.8 and 12.3 built, smoke-tested (--cap-drop ALL, UID 999), Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners. |
linux/arm64 | Published & natively tested | Both 11.8 and 12.3 built, smoke-tested (--cap-drop ALL, UID 999), Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native ARM64 CI runners. |
docker run -d --name mariadb \
--read-only \
--cap-drop ALL \
--security-opt no-new-privileges:true \
--tmpfs /run/mysqld:uid=999,gid=999,mode=1777,size=16m \
--tmpfs /tmp:mode=1777,size=128m \
-e MARIADB_ROOT_PASSWORD=change_me_root \
-e MARIADB_DATABASE=myapp \
-e MARIADB_USER=myapp \
-e MARIADB_PASSWORD=change_me_user \
-v mariadb_data:/var/lib/mysql \
-p 127.0.0.1:3306:3306 \
dgcosenza/mariadb:11.8
See docker-compose.example.yml:
services:
mariadb:
image: dgcosenza/mariadb:11.8
restart: unless-stopped
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /run/mysqld:uid=999,gid=999,mode=1777,size=16m
- /tmp:mode=1777,size=128m
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MARIADB_DATABASE=myapp
- MARIADB_USER=myapp
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
volumes:
- mariadb_data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
volumes:
mariadb_data:
Full drop-in compatibility with the official docker-library/mariadb entrypoint (including legacy MYSQL_* and *_FILE aliases):
| Variable | Description | Required |
|---|---|---|
MARIADB_ROOT_PASSWORD | Root password (or MARIADB_ROOT_PASSWORD_FILE for Docker secrets) | Yes¹ |
MARIADB_ROOT_PASSWORD_HASH | Pre-hashed root password | No |
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD | Allow an empty root password (development only) | No |
MARIADB_RANDOM_ROOT_PASSWORD | Generate a random root password printed to logs | No |
MARIADB_DATABASE | Create a database on first initialization | No |
MARIADB_USER | Create an application user on first initialization | No |
MARIADB_PASSWORD | Password for MARIADB_USER (or MARIADB_PASSWORD_FILE) | No² |
MARIADB_PASSWORD_HASH | Pre-hashed password for MARIADB_USER | No |
MARIADB_AUTO_UPGRADE | Run mariadb-upgrade automatically when needed | No |
MARIADB_REPLICATION_USER / MARIADB_REPLICATION_PASSWORD / MARIADB_MASTER_HOST | Replica setup | No |
¹ Required on first initialization unless MARIADB_ALLOW_EMPTY_ROOT_PASSWORD or MARIADB_RANDOM_ROOT_PASSWORD is set.
² Required when MARIADB_USER is set.
| Path / Port | Mode / Owner | Purpose |
|---|---|---|
/var/lib/mysql | 999:999 (mysql) | Persistent database data directory |
/docker-entrypoint-initdb.d | Read-only | First-start initialization scripts (*.sh, *.sql, *.sql.{gz,xz,zst}) |
/etc/mysql/conf.d | Read-only | Custom .cnf server overrides |
3306/tcp | Internal | MariaDB client protocol |
Runs as non-root mysql:mysql (UID/GID 999:999) by default, compatible with read_only: true, cap_drop: [ALL], and no-new-privileges:true.
healthcheck.sh --connect --innodb_initialized
mariadbmariadb-dump --all-databases --single-transaction) or physical backup (mariadb-backup) before changing images.mariadb:11.8 only to dgcosenza/mariadb:11.8 and mariadb:12.3 only to dgcosenza/mariadb:12.3. Never downgrade across major series.dgcosenza/mariadb:11.8@sha256:<digest> (or 12.3) and run docker compose up -d <service>.Every published digest (multi-arch index and per-architecture manifests for both 11.8 and 12.3) on both Docker Hub and GHCR is keyless-signed with Sigstore Cosign (GitHub OIDC), attested with SPDX and CycloneDX SBOMs, and backed by SLSA Build L3 provenance (actions/attest-build-provenance).
cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/mariadb-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/mariadb:12.3
# Or against Docker Hub (identical digest):
cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/mariadb-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
dgcosenza/mariadb:11.8
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp="^https://github\.com/dgcosenza/mariadb-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/mariadb@sha256:<arch-digest>
gh attestation verify oci://ghcr.io/dgcosenza/mariadb:12.3 --owner dgcosenza
--ignore-unfixed gate) and Grype scanning the SPDX SBOM (--only-fixed --fail-on negligible), and enforces a Dive efficiency gate (>= 95%, <= 5% wasted user bytes).gosu.renovate.json) pins base image digests and GitHub Action commit SHAs; Dependabot security alerts and OpenSSF Scorecard monitoring are enabled.SECURITY.md for responsible disclosure.# Build MariaDB 11.8 LTS
docker buildx build --platform linux/amd64 --load \
--build-arg MARIADB_MAJOR=11.8 \
--build-arg MARIADB_VERSION=11.8.10 \
-t dgcosenza/mariadb:11.8-local .
# Build MariaDB 12.3 LTS
docker buildx build --platform linux/amd64 --load \
--build-arg MARIADB_MAJOR=12.3 \
--build-arg MARIADB_VERSION=12.3.4 \
-t dgcosenza/mariadb:12.3-local .
.github/workflows/daily.yml runs automatically every day at 04:32 UTC, on pushes to main, on pull requests (verification only), and via workflow_dispatch:
MariaDB/server, tianon/gosu), archive.mariadb.org, go.dev, and Docker Hub for digest-pinned base images, emitting upstream-changes-11.8.md and upstream-changes-12.3.md.11.8 and 12.3 natively on linux/amd64 and linux/arm64 runners with --no-cache on schedule, running apt-get upgrade and compiling gosu from source with the latest patched Go release.tests/smoke.sh natively on all 4 matrix targets, enforces the Dive efficiency gate (>= 95%, <= 5% wasted), generates Syft SPDX + CycloneDX SBOMs per arch, and gates publication on 0 fixable findings of any severity in both Trivy and Grype (scanning the SPDX SBOM).11.8 and 12.3 on GHCR (ghcr.io/dgcosenza/mariadb) and mirrors identical digests to Docker Hub (dgcosenza/mariadb); signs every digest and attaches SPDX/CycloneDX SBOM attestations via Cosign keyless OIDC; emits SLSA Build L3 provenance for both series; and publishes a signed GitHub Release with checksums and SBOMs.versions.json, the README Current Versions block, and a dated CHANGELOG.md entry via github-actions[bot] ([skip ci], validated by public-check.sh), then syncs the Docker Hub overview and short description.ci-failure on any main or scheduled failure, and auto-closes it on the next green run.trixie-slim) base: Uses MariaDB's official Debian 13 (trixie) APT repository (archive.mariadb.org, GPG fingerprint 177F4010FE56CA3336300305F1656F24C74CD1D8) for both amd64 and arm64.gosu: Eliminates stale Go stdlib CVEs present in prebuilt upstream gosu binaries while keeping --user 0 step-down support intact.mariadbd PID 1 (exec): Ensures SIGTERM triggers a clean InnoDB shutdown without wrapper overhead.DL3008 ignore: Daily --no-cache security rebuilds intentionally pull the newest Debian 13 security updates via apt-get.This repository follows a clear packaging-vs-upstream license split:
packaging: MIT): Licensed under the MIT License — copyright Daniel G. Cosenza from FNX Labs.upstream: GPL-2.0-only): Copyright MariaDB Foundation and contributors — licensed under the GNU General Public License v2.0.Full third-party notices are maintained in THIRD-PARTY-NOTICES.md. Release history is maintained in CHANGELOG.md.
Maintained by Daniel G. Cosenza from FNX Labs.
Content type
Image
Digest
sha256:46ff6853b…
Size
124.4 MB
Last updated
about 13 hours ago
docker pull dgcosenza/mariadb