Hardened MySQL 8.4 LTS on Debian 13 (trixie) with daily CVE-gated builds and drop-in parity.
1.8K
A hardened, rootless MySQL 8.4 LTS Community Server container image on Debian 13 (trixie-slim), installing server and client packages from Oracle's official GPG-verified Debian 13 APT repository and compiling gosu from source with the latest patched Go toolchain, maintained by Daniel G. Cosenza from FNX Labs.
dgcosenza/mysqlghcr.io/dgcosenza/mysql (identical signed digest)dgcosenza/mysql-dockerGPL-2.0-only)| Component | Resolved Version |
|---|---|
| MySQL Community Server (LTS) | 8.4.13 (8.4.13.1-1debian13) |
| Step-down Helper | gosu 1.20 (Go 1.27.4) |
| Base OS | Debian 13.8 (trixie-slim) |
| Architectures | linux/amd64 |
| Uncompressed size (per arch) | amd64: 124.1 MB |
| Last verified build (UTC) | 2026-11-28 |
| Published multi-arch digest | dgcosenza/mysql@sha256:3a2e0fd0a843d58106991149180ae682a3e6c4bd965c6165fc68dc40204a8d9a |
| GHCR mirror | ghcr.io/dgcosenza/mysql@sha256:3a2e0fd0a843d58106991149180ae682a3e6c4bd965c6165fc68dc40204a8d9a |
| Supply chain | Cosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance |
| Security gate (Trivy + Grype on SBOM) | 0 fixable findings of any severity (14 upstream-unfixed) |
Recent upstream changes:
8.4.13 (8.4.13.1-1debian13) -> 8.4.13 (8.4.13.1-1debian13)1.20 -> 1.201.27.4 -> 1.27.4no8.4.13.1-1debian13). Release notes: https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-13.htmlIdentical OCI digests are published to Docker Hub (dgcosenza/mysql) and GHCR (ghcr.io/dgcosenza/mysql), accompanied by an automated signed GitHub Release:
| Tag | Policy | Description |
|---|---|---|
8.4.x-<YYYYMMDD> (e.g. 8.4.13-20261125) | Immutable | Date-stamped daily rebuild pinning the MySQL 8.4 LTS patch release and UTC build date. |
sha-<short> | Immutable | Packaging repository Git commit tag. |
8.4.x (e.g. 8.4.13) | Moving | Latest verified Debian 13 security rebuild of that MySQL patch release. |
8.4, latest | Moving | Latest verified daily MySQL 8.4 LTS build. |
Production pinning: Pin by immutable registry digest rather than an unpinned moving tag:
image: dgcosenza/mysql:8.4@sha256:<digest>
# or via GitHub Container Registry (identical digest):
image: ghcr.io/dgcosenza/mysql:8.4@sha256:<digest>
| Architecture | Status | Verification |
|---|---|---|
linux/amd64 | Published & natively tested | Built, smoke-tested (UID 999, initdb, CRUD, mysqldump, negative healthcheck), Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners. |
linux/arm64 | Not shipped upstream | Oracle's official Debian 13 (trixie) APT repository (repo.mysql.com/apt/debian/dists/trixie/Release) publishes amd64 packages only. arm64 will be enabled automatically if Oracle adds arm64 Debian 13 binaries. |
docker run -d --name mysql84 \
--read-only \
--cap-drop ALL \
--cap-add SYS_NICE \
--security-opt no-new-privileges:true \
--tmpfs /var/run/mysqld:uid=999,gid=999,mode=1777,size=16m \
--tmpfs /tmp:mode=1777,size=128m \
-e MYSQL_ROOT_PASSWORD=change_me_root \
-e MYSQL_DATABASE=myapp \
-e MYSQL_USER=myapp \
-e MYSQL_PASSWORD=change_me_user \
-v mysql_data:/var/lib/mysql \
-p 127.0.0.1:3306:3306 \
dgcosenza/mysql:8.4
See docker-compose.example.yml:
services:
mysql:
image: dgcosenza/mysql:8.4
restart: unless-stopped
read_only: true
cap_drop:
- ALL
cap_add:
- SYS_NICE
security_opt:
- no-new-privileges:true
tmpfs:
- /var/run/mysqld:uid=999,gid=999,mode=1777,size=16m
- /tmp:mode=1777,size=128m
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=myapp
- MYSQL_USER=myapp
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
volumes:
mysql_data:
Full drop-in compatibility with the official docker-library/mysql:8.4 entrypoint:
| Variable | Description | Required |
|---|---|---|
MYSQL_ROOT_PASSWORD | Password for root (or MYSQL_ROOT_PASSWORD_FILE for Docker secrets) | Yes¹ |
MYSQL_ALLOW_EMPTY_PASSWORD | Allow empty root password (development only) | No |
MYSQL_RANDOM_ROOT_PASSWORD | Generate a random root password printed to logs | No |
MYSQL_DATABASE | Database created on first initialization | No |
MYSQL_USER | Application user created on first initialization | No |
MYSQL_PASSWORD | Password for MYSQL_USER (or MYSQL_PASSWORD_FILE) | No² |
MYSQL_ROOT_HOST | Host pattern allowed for root (default: %) | No |
MYSQL_ONETIME_PASSWORD | Force root password change on first login | No |
MYSQL_INITDB_SKIP_TZINFO | Skip loading timezone tables during init | No |
¹ Required on first initialization unless MYSQL_ALLOW_EMPTY_PASSWORD or MYSQL_RANDOM_ROOT_PASSWORD is set.
² Required if MYSQL_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,bz2}) |
/etc/mysql/conf.d | Read-only | Custom .cnf server overrides |
3306/tcp, 33060/tcp | Internal | Classic MySQL and X Protocol ports |
Runs as non-root mysql:mysql (UID/GID 999:999) by default, compatible with read_only: true, cap_drop: [ALL] (optional cap_add: [SYS_NICE] for InnoDB thread priority), and no-new-privileges:true.
healthcheck.sh verifies that /var/run/mysqld/mysqld.sock is live and executes SELECT 1; over the Unix socket when MYSQL_ROOT_PASSWORD (or MYSQL_ROOT_PASSWORD_FILE) is available.
mysql:8.4This image is data-directory compatible with upstream mysql:8.4:
mysqldump --all-databases --single-transaction --routines --triggers before switching.docker compose down -v. Recreate only the database service (docker compose up -d --no-deps <service>).dgcosenza/mysql:8.4@sha256:<digest> (or GHCR).Every published digest 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/mysql-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/mysql:8.4
# Or against Docker Hub (identical digest):
cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/mysql-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
dgcosenza/mysql:8.4
cosign verify-attestation \
--type spdxjson \
--certificate-identity-regexp="^https://github\.com/dgcosenza/mysql-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/mysql@sha256:<digest>
gh attestation verify oci://ghcr.io/dgcosenza/mysql:8.4 --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.docker buildx build --platform linux/amd64 --load \
--build-arg MYSQL_DEB_VERSION=8.4.13.1-1debian13 \
--build-arg MYSQL_UPSTREAM_VERSION=8.4.13 \
-t dgcosenza/mysql:8.4-local .
.github/workflows/daily.yml runs automatically every day at 04:47 UTC, on pushes to main, on pull requests (verification only), and via workflow_dispatch:
repo.mysql.com), tianon/gosu, go.dev, and Docker Hub for digest-pinned base images, emitting upstream-changes.md.debian:trixie-slim with --no-cache on schedule, running apt-get upgrade and compiling gosu from source with the latest patched Go release.tests/smoke.sh, enforces the Dive efficiency gate (>= 95%, <= 5% wasted), generates Syft SPDX + CycloneDX SBOMs, and gates publication on 0 fixable findings of any severity in both Trivy and Grype (scanning the SPDX SBOM).ghcr.io/dgcosenza/mysql) and Docker Hub (dgcosenza/mysql) with tags latest, 8.4, <version>, <version>-<YYYYMMDD>, and sha-<short>; signs and attests SPDX/CycloneDX SBOMs via Cosign keyless OIDC; emits SLSA Build L3 provenance; 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) + official Oracle MySQL APT repo: Upstream mysql:8.4 is based on Oracle Linux 9 (oraclelinux:9-slim), which carries dozens of stale RPM vulnerabilities and bundles mysql-shell (with Python libraries). Building on Debian 13 (trixie-slim) using Oracle's signed mysql-8.4-lts Debian 13 repository (BCA43417C3B485DD128EC6D4B7B3B788A8D3785C) eliminates those CVEs while preserving binary-identical MySQL 8.4 LTS storage compatibility.linux/amd64 only: Oracle's official Debian 13 APT feed (repo.mysql.com/apt/debian/dists/trixie/Release) currently ships Architectures: amd64 only.gosu: Compiling gosu with the latest Go release eliminates Go stdlib CVEs found in prebuilt binaries.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 Oracle and/or its affiliates — 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:3a2e0fd0a…
Size
118.4 MB
Last updated
about 12 hours ago
docker pull dgcosenza/mysql