Nowadays, there are more and more people starting to use docker to containerize their applications, and MySQL is the most popular one.It is as simple as one command line to create and start your own database:
docker run -d –P tutum/mysql
However if you decide to replace MySQL with MariaDB in the future, data migration will be painful to perform. Tutum MySQL/MariaDB images help solve this problem.
Here is a simple example:
1. Create a volume container that holds database data
docker run -d -v /var/lib/mysql –name db_vol -p 22:22 tutum/ubuntu:trusty
Note: you can change the name of the volume container, which will be used in the next step. The volume path (/var/lib/mysql) should not be changed.
2. Create a MySQL container and write data to the volume container:
docker run -d –volumes-from db_vol -p 3306:3306 tutum/mysql:5.5
Note: –volumes-from should use the name of the volume container.
Here’s the log…
View original post 161 more words