Build mysql image with prepopulated data and specify data at the host OS for future managing.
In the project directory, you can run below commands
builds mysql docker image along with copying over database directory folder from container to Host. setup.sql is also executed while preparing the mysql docker image. change the root password on the Dockerfile.
starts mysql docker image while mounting pre-initialized database directory. change the root password on the Dockerfile.
stops mysql container
setup.sql included script to prepopulate database
charset is defined at 'charset.cnf' file
docker run -it --rm --link mysql mariadb:latest mysql -hmysql -uroot -proot myexample -e "select \* from mytable;"
mysql -h localhost -P 3306 --protocol=tcp -u root