MySQL on Docker.
docker pull quay.io/aptible/mysql
docker run quay.io/aptible/mysql
This will launch a MySQL server that enforces SSL for any TCP connection. Important note: Because the key and certificate used for SSL negotiation are included in the Docker image, and shared by all Docker clients running the same version of the image, a MySQL server launched with just docker run is NOT suitable for production.
To generate a unique key/certificate pair, you have two options:
-
Build directly from the Dockerfile, disabling caching:
docker build --no-cache . -
Initialize a new key and certificate in the host volume and mount that directory into the Docker container.
id=$(docker run -P -d quay.io/aptible/mysql)
docker cp $id:/var/lib/mysql <host-mountpoint>
docker stop $id
docker run -v <host-mountpoint>/mysql:/var/lib/mysql quay.io/aptible/mysql sh -c "service mysql start && mysql -u root -e \"GRANT ALL ON *.* to 'aptible'@'%' IDENTIFIED BY 'password';\""
docker run -v <host-mountpoint>/mysql:/var/lib/mysql quay.io/aptible/mysql sh -c "service mysql start && mysql -u root -e \"CREATE DATABASE db;\""
latest: Currently Percona MySQL 5.6.19
Tests are run as part of the Dockerfile build. To execute them separately within a container, run:
bats test
To push the Docker image to Quay, run the following command:
make release
MIT License, see LICENSE for details.
Copyright (c) 2014 Aptible and contributors.