HUB
Sign inSign up
mariadb logo

dgcosenza/mariadb

By dgcosenza

•Updated about 13 hours ago

Hardened MariaDB 11.8 & 12.3 LTS on Debian 13 (trixie) with daily CVE-gated builds.

Image
0

5.3K

dgcosenza/mariadb repository overview

⁠MariaDB on Debian 13 (trixie) — Hardened Container Image

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

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.


⁠Current Versions

Last verified build: 2026-11-28 (UTC) — multi-arch (linux/amd64, linux/arm64), Cosign OIDC signed, SPDX & CycloneDX SBOM attested, SLSA Build L3 provenance.

TrackUpstream VersionBase OSStep-down HelperUncompressed SizeFixable findings of any severity (Trivy + Grype SBOM)
11.8 (LTS)11.8.10Debian 13.8gosu 1.20 (Go 1.27.4)amd64: 129.0 MB, arm64: 455.8 MB0 (18 unfixed)
12.3 (LTS)12.3.4Debian 13.8gosu 1.20 (Go 1.27.4)amd64: 130.5 MB, arm64: 460.6 MB0 (18 unfixed)

Published multi-arch digests (identical on Docker Hub & GHCR):

  • MariaDB 11.8 (11.8.10): dgcosenza/mariadb@sha256:fd0339233400d457518b551e84cca6685c71988679896f37ac64a5687f00fa51 / ghcr.io/dgcosenza/mariadb@sha256:fd0339233400d457518b551e84cca6685c71988679896f37ac64a5687f00fa51
  • MariaDB 12.3 (12.3.4): dgcosenza/mariadb@sha256:46ff6853bedc588e6c0946b134533cce0178e12160d4efb80163be2157430963 / ghcr.io/dgcosenza/mariadb@sha256:46ff6853bedc588e6c0946b134533cce0178e12160d4efb80163be2157430963

⁠Supported Tags & Tag Policy

Identical 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 PatternTrackPolicyNotes
11.8.x-<YYYYMMDD>, 11.8-sha-<short>MariaDB 11.8 LTSImmutableDate- and commit-pinned daily 11.8 LTS builds
11.8, latest-11.8, 11.8.xMariaDB 11.8 LTSMovingLatest verified daily 11.8 LTS build
12.3.x-<YYYYMMDD>, 12.3-sha-<short>, sha-<short>MariaDB 12.3 LTSImmutableDate- and commit-pinned daily 12.3 LTS builds
latest, 12.3, latest-12.3, 12.3.xMariaDB 12.3 LTSMovingLatest 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>

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedBoth 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/arm64Published & natively testedBoth 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.

⁠Quick Start

⁠Docker CLI (hardened, rootless)
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
⁠Hardened Docker Compose

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:

⁠Configuration

⁠Environment Variables

Full drop-in compatibility with the official docker-library/mariadb entrypoint (including legacy MYSQL_* and *_FILE aliases):

VariableDescriptionRequired
MARIADB_ROOT_PASSWORDRoot password (or MARIADB_ROOT_PASSWORD_FILE for Docker secrets)Yes¹
MARIADB_ROOT_PASSWORD_HASHPre-hashed root passwordNo
MARIADB_ALLOW_EMPTY_ROOT_PASSWORDAllow an empty root password (development only)No
MARIADB_RANDOM_ROOT_PASSWORDGenerate a random root password printed to logsNo
MARIADB_DATABASECreate a database on first initializationNo
MARIADB_USERCreate an application user on first initializationNo
MARIADB_PASSWORDPassword for MARIADB_USER (or MARIADB_PASSWORD_FILE)No²
MARIADB_PASSWORD_HASHPre-hashed password for MARIADB_USERNo
MARIADB_AUTO_UPGRADERun mariadb-upgrade automatically when neededNo
MARIADB_REPLICATION_USER / MARIADB_REPLICATION_PASSWORD / MARIADB_MASTER_HOSTReplica setupNo

¹ Required on first initialization unless MARIADB_ALLOW_EMPTY_ROOT_PASSWORD or MARIADB_RANDOM_ROOT_PASSWORD is set.
² Required when MARIADB_USER is set.

⁠Volumes, Ports, and UID/GID
Path / PortMode / OwnerPurpose
/var/lib/mysql999:999 (mysql)Persistent database data directory
/docker-entrypoint-initdb.dRead-onlyFirst-start initialization scripts (*.sh, *.sql, *.sql.{gz,xz,zst})
/etc/mysql/conf.dRead-onlyCustom .cnf server overrides
3306/tcpInternalMariaDB 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

healthcheck.sh --connect --innodb_initialized

⁠Upgrade and Migration from Upstream mariadb

  1. Back up first: Take a verified logical dump (mariadb-dump --all-databases --single-transaction) or physical backup (mariadb-backup) before changing images.
  2. Match the major series: Migrate mariadb:11.8 only to dgcosenza/mariadb:11.8 and mariadb:12.3 only to dgcosenza/mariadb:12.3. Never downgrade across major series.
  3. Keep rollback ready: Tag the previous image locally before switching.
  4. Switch image reference: Pin dgcosenza/mariadb:11.8@sha256:<digest> (or 12.3) and run docker compose up -d <service>.

⁠Supply-Chain Verification

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).

⁠Verify image signature with Cosign
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
⁠Verify SPDX / CycloneDX SBOM attestations
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>
⁠Verify SLSA Build Provenance
gh attestation verify oci://ghcr.io/dgcosenza/mariadb:12.3 --owner dgcosenza

⁠Security

  • Preflight gates: Every push and PR runs Hadolint (blocking on warning+), Gitleaks secret scanning across git history, and public-content/attribution checks.
  • Vulnerability scan policy (all severities with a fix): Every build generates SPDX and CycloneDX SBOMs with Syft per series and architecture, scans with Trivy (table, JSON, SARIF upload, blocking --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).
  • Current status: 0 fixable vulnerabilities of any severity across Debian 13 OS packages, MariaDB 11.8/12.3 LTS, and source-built gosu.
  • Dependency automation: Renovate (renovate.json) pins base image digests and GitHub Action commit SHAs; Dependabot security alerts and OpenSSF Scorecard monitoring are enabled.
  • See SECURITY.md⁠ for responsible disclosure.

⁠Build Locally

# 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 .

⁠Update Policy

.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:

  1. Preflight & upstream check: Runs public-content checks, Hadolint, and Gitleaks; queries the authenticated GitHub API (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.
  2. Multi-arch no-cache rebuild: Rebuilds both 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.
  3. Smoke, Dive & vulnerability gates: Runs 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).
  4. Dual-registry publish & supply-chain signing: Assembles multi-arch OCI manifest indexes for both 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.
  5. Automated documentation sync: Commits updated 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.
  6. Failure alerting: Opens or updates a single GitHub issue labeled ci-failure on any main or scheduled failure, and auto-closes it on the next green run.

⁠Design Decisions

  • Debian 13 (trixie-slim) base: Uses MariaDB's official Debian 13 (trixie) APT repository (archive.mariadb.org, GPG fingerprint 177F4010FE56CA3336300305F1656F24C74CD1D8) for both amd64 and arm64.
  • Source-rebuilt gosu: Eliminates stale Go stdlib CVEs present in prebuilt upstream gosu binaries while keeping --user 0 step-down support intact.
  • Direct mariadbd PID 1 (exec): Ensures SIGTERM triggers a clean InnoDB shutdown without wrapper overhead.
  • Hadolint DL3008 ignore: Daily --no-cache security rebuilds intentionally pull the newest Debian 13 security updates via apt-get.

⁠License

This repository follows a clear packaging-vs-upstream license split:

  • Container packaging, CI workflows, and documentation (packaging: MIT): Licensed under the MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs.
  • Bundled upstream software — MariaDB Server & upstream entrypoint/healthcheck scripts (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⁠.

⁠Credits

Maintained by Daniel G. Cosenza from FNX Labs.

Tag summary

Content type

Image

Digest

sha256:46ff6853b…

Size

124.4 MB

Last updated

about 13 hours ago

docker pull dgcosenza/mariadb