MariaDB is the open source successor to MySQL.
This Dockerfile is intended to be used to set up a standalone MariaDB database server.
- 10.4 Dockerfile (Alpine 3.12 Support until May 2022) -
- 10.5 Dockerfile (Alpine 3.14 Support until May 2023) -
- 10.6 Dockerfile (Alpine 3.16 Support until May 2024) -
- 10.11 Dockerfile (Alpine 3.18 Support until May 2025) -
As these images are not built from the upstream MariaDB images, their support follows a different cycle - and will only receive updates as long as the underlying Alpine images receive support - see https://alpinelinux.org/releases/ for more information. In practice, most MariaDB users will only be running these containers locally - the production instances will use the Managed Cloud Databases provided by the DBaaS Operator
The default exposed port of MariaDB containers is port
To allow Lagoon to select the best way to run the MariaDB container, use
lagoon.type: mariadb - this allows the DBaaS operator to provision a cloud database if available in the cluster. Use
lagoon.type: mariadb-single to specifically request MariaDB in a container. Persistent storage is always provisioned for MariaDB containers at
This image is prepared to be used on Lagoon. There are therefore some things already done:
- Folder permissions are automatically adapted with
fix-permissions, so this image will work with a random user.
readiness-probe.shscript to check when MariaDB container is ready.
# tells Lagoon this is a MariaDB database
# exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
# mounts a named volume at the default path for MariaDB
mysqltuner.pl- Perl script useful for database parameter tuning.
mysql-backup.sh- Script for automating the daily MySQL backups on development environment.
pwgen- Utility to generate random and complex passwords.
my.cnf configuration file#
The image ships a default MariaDB configuration file, optimized to work on Lagoon. Some options are configurable via environment variables.
|Database name created at startup.
|Default user created at startup.
|Password of default user created at startup.
|MariaDB root user's password.
|Set the server charset.
|Set server collation.
|Set the MariaDB InnoDB buffer pool size.
|Number of InnoDB buffer pool instances.
|Size of InnoDB log file.
|Variable to control the save of slow queries.
|Variable to control the save of ALL queries.
|Default path for databases backups.
|Path of the MariaDB data dir, be careful, changing this can occur data loss!
|Path which the entrypoint script of mariadb will use to copy into the defined
MARIADB_DATA_DIR, this can be used for prepopulating the MariaDB with a database. The scripts expects actual MariaDB data files and not a sql file! Plus it only copies data if the destination does not already have a mysql datadir in it.
LAGOON_ENVIRONMENT_TYPE variable is set to
are set accordingly by using