This is (yet another) MySQL container. This one is built using the official MySQL APT Repository for MySQL Community Server 5.6.
To run the container:
docker run \ -d \ -v $HOME/mysql56:/var/lib/mysql \ -p 13306:3306 \ -e "MYSQL_ROOT_PASSWORD=mysecretpassword" \ rchouinard/mysql:latest
This command will create a new container based on the new MySQL image built
-dtells Docker to run the container as a daemon
-v $HOME/mysql56:/var/lib/mysqlmaps the local path
/var/lib/mysqlinside the container. This allows the MySQL data to persist
-p 13306:3306maps the local port
13306to the container's port
This lets us connect to the instance as shown below.
-e "MYSQL_ROOT_PASSWORD=mysecretpassword"sets the root password for the
instance. This really only needs to be specified on the first run.
rchouinard/mysql:latestuses the latest rchouinard/mysql image for the container.
Be sure to adjust any of the parameters to meet your requirements.
If you used the run command above, you can now connect to the instance using
your client of choice.
mysql -uroot -p -h127.0.0.1 -P13306
Use the password you selected above (
mysecretpassword in the example) and you
should be greeted with the server banner. Yay!