Simple mariadb docker image with startup scripts.
docker pull michaloo/mariadb
docker build -t michaloo/mariadb .
Environmental variables to set:
If /var/lib/mysql/mysql doesn't exists script executes mysql_install_db.
Then using mysqld --bootstrap it sets root password and tries to create database and user (specified via above variables).
Configuration options are supplied via /etc/mysql/conf.d/my.cnf file which is generated on every start using /app/config/my.cnf template (overriding it allows customization).
If image is run as an interactive, linked container (options: -it --link mariadb:mysql --entrypoint=/bin/bash) there is a useful script /app/bin/connect which executes mysql with data supplied via environmental variables (see below)
For persistance create a storage container:
docker run -d --name data_mysql_test -v /var/lib/mysql tianon/true
Use it and provide environmental variables (using .env file)
docker run -d --name mariadb -P --env-file .env --volumes-from data_mysql_test michaloo/mariadb
Connect with it in an another container:
docker run -it --link mariadb:mysql --env-file .env --entrypoint=/bin/bash michaloo/mariadb /app/bin/connect
Following solutions were used in this image:
https://github.com/orchardup/docker-mysql/blob/master/run https://github.com/GoogleCloudPlatform/compute-docker-mysql/blob/master/run-mysqld https://github.com/CenturyLinkLabs/docker-mysql/blob/master/my.cnf
Content type
Image
Digest
sha256:29211bfc7…
Size
128.1 MB
Last updated
almost 11 years ago
docker pull michaloo/mariadb