These are docker images for MariaDB database
3.9K
These are docker images for MariaDB database. Mainly, it's to manage healthcheck with credential specified by secrets.
The base image is from official MariaDB.
pfillion/mariadb:latest at Docker HubThe MariaDB startup configuration is specified in the file /etc/mysql/my.cnf, and that file in turn includes any files found in the /etc/mysql/conf.d directory that end with .cnf. Settings in files in this directory will augment and/or override settings in /etc/mysql/my.cnf. If you want to use a customized MySQL configuration, you can create your alternative configuration file in a directory on the host machine and then mount that directory location as /etc/mysql/conf.d inside the mariadb container.
If /my/custom/config-file.cnf is the path and name of your custom configuration file, you can start your mariadb container like this (note that only the directory path of the custom config file is used in this command):
docker run --name some-mariadb -v /my/custom:/etc/mysql/conf.d -e MARIADB_ROOT_PASSWORD=my-secret-pw -d mariadb:tag
This will start a new container some-mariadb where the MariaDB instance uses the combined startup settings from /etc/mysql/my.cnf and /etc/mysql/conf.d/config-file.cnf, with settings from the latter taking precedence.
When you start the mariadb image, you can adjust the configuration of the MariaDB instance by passing one or more environment variables on the docker run command line. Do note that none of the variables below will have any effect if you start the container with a data directory that already contains a database: any pre-existing database will always be left untouched on container startup.
MARIADB_ROOT_PASSWORDThis variable is mandatory and specifies the password that will be set for the MariaDB root superuser account. In the above example, it was set to my-secret-pw.
MARIADB_DATABASEThis variable is optional and allows you to specify the name of a database to be created on image startup. If a user/password was supplied (see below) then that user will be granted superuser access (corresponding to GRANT ALL) to this database.
MARIADB_USER, MARIADB_PASSWORDThese variables are optional, used in conjunction to create a new user and to set that user's password. This user will be granted superuser permissions (see above) for the database specified by the MARIADB_DATABASE variable. Both variables are required for a user to be created.
Do note that there is no need to use this mechanism to create the root superuser, that user gets created by default with the password specified by the MARIADB_ROOT_PASSWORD variable.
MARIADB_ALLOW_EMPTY_PASSWORDThis is an optional variable. Set to yes to allow the container to be started with a blank password for the root user. NOTE: Setting this variable to yes is not recommended unless you really know what you are doing, since this will leave your MariaDB instance completely unprotected, allowing anyone to gain complete superuser access.
MARIADB_RANDOM_ROOT_PASSWORDThis is an optional variable. Set to yes to generate a random initial password for the root user (using pwgen). The generated root password will be printed to stdout (GENERATED ROOT PASSWORD: .....).
MOBYCRON_ENABLEDThis is an optional variable. Set to true or 1 to enable mobycron deamon. The configuration is specified in the file /configs/config.json. By default, this configuration includes a daily backup of the server. The compressed backup file is created in the volume /var/mariadb/backup.
As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:
docker run --name some-mysql -e MARIADB_ROOT_PASSWORD_FILE=/run/secrets/mysql-root -d mariadb:tag
Currently, this is only supported for MARIADB_ROOT_PASSWORD, MARIADB_ROOT_HOST, MARIADB_DATABASE, MARIADB_USER, and MARIADB_PASSWORD.
This container provides a script that instructs Docker how to check if the mariadb server still working. For example:
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck"]
interval: 30s
timeout: 30s
retries: 5
MIT
Content type
Image
Digest
sha256:6f159c3f4…
Size
159.8 MB
Last updated
10 months ago
docker pull pfillion/mariadb