Notes Docker MariaDB

Voir :

https://hub.docker.com/_/mariadb/

https://mariadb.com/kb/en/library/installing-and-using-mariadb-via-docker/

Création du réseau

docker network create --subnet=172.19.0.0/16 --gateway 172.19.0.1 mynet19

Lancement du conteneur

docker run --rm --net=mynet19 --ip=172.19.0.10 -v /docker-store/var/lib/mysql/:/var/lib/mysql/ -e MYSQL_ROOT_PASSWORD=password -d mariadb --sql_mode='NO_ENGINE_SUBSTITUTION'

Exemple avec fichier de conf my.cnf

mkdir -p /docker-store/etc/mysql/conf.d cat > /docker-store/etc/mysql/conf.d/sql_mode.cnf <<EOF [mysqld] sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION EOF chmod -R a+rX /docker-store/etc/mysql

Lancement du conteneur

docker run --rm --net=mynet19 --ip=172.19.0.10 -v /docker-store/var/lib/mysql/:/var/lib/mysql/ -v /docker-store/etc/mysql/conf.d:/etc/mysql/conf.d:ro -e MYSQL_ROOT_PASSWORD=password -d mariadb

Adminer / PhpMyAdmin

docker run -d --rm --net=mynet19 -p 8082:80 clue/adminer