HUB
Sign inSign up
mysql-percona logo

lotuswebagency/mysql-percona

By lotuswebagency

•Updated 2 days ago

Percona Server 8.4/9.7 LTS built from source with PGO+LTO, hardened, on Wolfi. XtraBackup included.

Image
Databases & storage
0

2.0K

lotuswebagency/mysql-percona repository overview

⁠lotuswebagency/mysql-percona

Percona Server for MySQL 8.4 LTS and 9.7 LTS, compiled from source with PGO, hardened, sized to your container, with XtraBackup inside.

Typical MySQL images ship distribution packages on a full Debian userland, start with a 128 MB buffer pool whatever memory you give them, and leave backups to a separate image. This one compiles Percona Server from pinned source on a minimal Wolfi base, tunes InnoDB and the thread pool from the container's limits on every start, and includes XtraBackup at the same version as the server.

  • Fast. PGO and LTO, trained on Percona's test suite plus a sysbench OLTP run: 7 to 18% more throughput than percona/percona-server:8.4 and mysql:8.4 with identical settings (benchmarks⁠).
  • Sized to the container. The buffer pool, redo log and thread pool follow --memory and --cpus. On disk-bound workloads that is +20 to 200% over the 128 MB default.
  • Backups included. XtraBackup full, incremental, streamed and compressed backups, plus CLONE and point-in-time recovery, all covered by the test suite.
  • Small and hardened. About 310 MB (8.4) and 325 MB (9.7). Runs as UID 1001, read-only root supported, compiler hardening and CET or BTI/PAC, connection_control against brute force, ECDHE-only TLS generated on first start. Unused auth plugins, MyRocks, NDB and telemetry are not built.
  • Verifiable. Trivy-gated (no fixable HIGH or CRITICAL findings), Cosign-signed, with an SBOM and SLSA provenance. linux/amd64 and linux/arm64, rebuilt weekly.
  • Drop-in. The familiar MYSQL_* variables and /docker-entrypoint-initdb.d of the docker-library images; data directories from dementev/mysql-percona and percona/percona-server start as they are.

GitHub⁠ · Full documentation⁠ · Lotus Web Agency⁠

⁠Quick start

services:
  db:
    image: lotuswebagency/mysql-percona:8.4
    restart: unless-stopped
    mem_limit: 4g        # buffer pool and redo log: 2 GB each
    cpus: 2              # thread pool size: 2
    environment:
      MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_root_password
      MYSQL_DATABASE: app
      MYSQL_USER: app
      MYSQL_PASSWORD: change-me
    secrets: [mysql_root_password]
    volumes:
      - mysql-data:/var/lib/mysql
secrets:
  mysql_root_password:
    file: ./secrets/mysql_root_password   # readable by UID 1001
volumes:
  mysql-data:

Scripts in /docker-entrypoint-initdb.d (.sh, .sql, compressed .sql) run once on an empty data directory; scripts in /docker-entrypoint-always.d run on every start.

⁠Tags

TagMeaning
8.4, 9.7Series. Follows the newest release of that series.
8.4.13-13, 9.7.2-3Exact Percona Server version, rebuilt weekly.
latestThe newest series, currently 9.7.
<tag>-v3The same, for x86-64-v3 or Neoverse N2/V2 class arm64 CPUs.

Pin a series tag for a database, never latest. A newer series upgrades the data directory on first start, and that cannot be undone. Use the default tags on Apple silicon, Graviton2 or Graviton3.

⁠Environment variables

Variables that carry a value (passwords, names, sizes) also have a _FILE form for Docker secrets, e.g. MYSQL_ROOT_PASSWORD_FILE.

VariableDefaultEffect
MYSQL_ROOT_PASSWORDRoot password. This, MYSQL_RANDOM_ROOT_PASSWORD or MYSQL_ALLOW_EMPTY_PASSWORD is required on first start
MYSQL_ROOT_HOST%localhost disables remote root
MYSQL_DATABASEDatabase created on first start
MYSQL_USER, MYSQL_PASSWORDAccount with all privileges on MYSQL_DATABASE
MYSQL_BACKUP_PASSWORDCreates the xtrabackup account for backups and CLONE
MYSQL_INNODB_BUFFER_POOL_SIZE50% of the memory limite.g. 2G
MYSQL_INNODB_REDO_LOG_CAPACITYbuffer pool size, max 8Ge.g. 1G
MYSQL_THREAD_HANDLINGpool-of-threadsor one-thread-per-connection
MYSQL_THREAD_POOL_SIZEthe CPU quotaPositive integer
MYSQL_SERVER_ID, MYSQL_REPORT_HOSTReplication settings
MYSQL_READ_ONLY, MYSQL_SUPER_READ_ONLYON or OFF

Without a memory limit InnoDB keeps 128 MB; set MYSQL_INNODB_BUFFER_POOL_SIZE. Your own *.cnf files go in /etc/mysql/conf.d/. All variables and defaults: configuration reference⁠.

⁠Image facts

  • Port 3306. User mysql, UID and GID 1001. Data in /var/lib/mysql. Built-in healthcheck.
  • Defaults: utf8mb4, GTID on, strict SQL mode, skip-name-resolve, local_infile off.
  • TLS 1.2 and 1.3 with an auto-generated certificate. Mount your own at /etc/mysql/ssl/ for VERIFY_IDENTITY.
  • No X Protocol (33060) and no PMM client; run percona/pmm-client as a sidecar.

⁠Backups

docker exec db xtrabackup --user=xtrabackup --password=... --backup --target-dir=/backup/full
docker exec db xtrabackup --prepare --target-dir=/backup/full

Incremental, streamed, replica and CLONE recipes: Backups⁠.

⁠Hardened deployment

docker run -d --name db \
  --read-only --cap-drop ALL --security-opt no-new-privileges \
  --tmpfs /tmp:mode=1777 \
  --tmpfs /var/run/mysqld:uid=1001,gid=1001,mode=0750 \
  --tmpfs /etc/mysql/env.d:uid=1001,gid=1001,mode=0750 \
  --tmpfs /etc/mysql/ssl:uid=1001,gid=1001,mode=0750 \
  --tmpfs /var/log/mysql:uid=1001,gid=1001,mode=0750 \
  --tmpfs /tmp-replica:uid=1001,gid=1001,mode=0750 \
  -e MYSQL_ROOT_PASSWORD=change-me -e MYSQL_ROOT_HOST=localhost \
  -v mysql-data:/var/lib/mysql \
  lotuswebagency/mysql-percona:8.4

⁠Benchmarks

Measured in December 2026 with sysbench 1.0.20 on an idle Xeon E-2286G (6 cores): the server on 3 cores, sysbench on the other 3, 8 tables of 100,000 rows, data on tmpfs, 60 s per measurement, median of 3 rounds in rotated order.

Same settings for all three (1 GB buffer pool, 1 GB redo log, one thread per connection, binary log and GTID on; checked by diffing SHOW GLOBAL VARIABLES). Transactions per second at 16 threads:

Workloadlotuswebagency/mysql-percona:8.4percona/percona-server:8.4mysql:8.4
oltp_point_select152,411132,088 (ours +15%)133,961 (ours +14%)
oltp_read_only5,6304,934 (ours +14%)4,970 (ours +13%)
oltp_read_write3,4923,069 (ours +14%)3,098 (ours +13%)
oltp_write_only12,23010,916 (ours +12%)11,122 (ours +10%)

Across 1, 16 and 64 threads ours was 7 to 18% faster than both, with equal or lower p95 latency (up to 14% lower). Versions: ours 8.4.11-12, Percona 8.4.13-13, MySQL 8.4.13.

Each image's own defaults in a --memory 4g --cpus 4 container, data on disk, a 1 GB dataset: ours served about twice the point-select throughput and 16 to 27% more read-write transactions. That gain comes mostly from sizing: ours gives InnoDB 2 GB and a thread pool, the others keep a 128 MB buffer pool.

⁠Verify the image

cosign verify lotuswebagency/mysql-percona:8.4 \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --certificate-identity 'https://github.com/LotusWebAgency/mysql-percona/.github/workflows/ci.yml@refs/heads/main'

⁠Migrating

⁠More images from Lotus Web Agency

ImageWhat it does
dementev/angie⁠ — source⁠Public-facing reverse proxy and TLS terminator — Angie, the nginx fork, with brotli, zstd and cache-purge
dementev/nginx⁠ — source⁠Static sites and SPAs behind that proxy — brotli/zstd siblings, Prometheus stub_status
lotuswebagency/php⁠ — source⁠PHP 7.0 → 8.5 compiled from source on Wolfi, hardened and signed — successor to the deprecated dementev/php-fpm-with-ext
lotuswebagency/nginx-nodejs⁠ — source⁠Rootless Node.js runtime behind Nginx, with sanitized logs and optional Loki delivery
lotuswebagency/mysql-percona⁠ — this imagePercona Server for MySQL 8.4 and 9.7 LTS with XtraBackup, compiled from source with PGO and hardened — the from-source successor to dementev/mysql-percona
dementev/mysql-percona⁠ — source⁠Percona Server for MySQL 8.4 LTS, XtraBackup built in, no root inside
dementev/adminer⁠ — source⁠Adminer 6 with every driver it supports, for reaching any of the above

⁠About

Built and maintained by Vasilii Dementev⁠ at Lotus Web Agency⁠. All our open-source work: lotuswebagency.com/open-source⁠.

Issues and pull requests: GitHub⁠. Security reports: SECURITY.md⁠. Packaging is MIT licensed; Percona Server and XtraBackup are GPL-2.0, with license texts in /usr/share/licenses/ and source details in NOTICE⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:8e61e2e5c…
Size
108.6 MB
Last updated
2 days ago
docker pull lotuswebagency/mysql-percona:latest