sudo docker pull marksteve/pagekit
Firstly, go to a directory where scripts from gir repo should be stored.
git clone https://github.com/tutumcloud/tutum-docker-mysql.git
docker build -t tutum/mysql .
sudo docker run -d -p 3307:3306 -e MYSQL_PASS=admin -v /var/www/html/docker/mysql/data:/var/lib/mysql --name mysql tutum/mysql
Notes:
- Local port 3307 is mounted to container port 3306. I use port 3307 because port 3306 is used with my local mysql server.
- Mysql container will use local folder /var/www/html/docker/mysql/data as data volume to store database data so data will not be erased together with stopping the container.
It is possible to log into mysql container to execute some SQL queries. In our case we need to create a database for Pagekit.
mysql -uadmin -padmin -P3307 -h 0.0.0.0
create database pagekit;
To return back: exit;
sudo docker run -d -p 8000:80 --link mysql:mysql --name pagekit marksteve/pagekit
- host: mysql (alias of the mysql container has correct ip address at hosts file)
- user: admin
- pass: admin
- database: pagekit