利用github上的dockerfile一分钟快速创建LAMP开发环境
时间:2015-01-29 17:53:08
收藏:0
阅读:307
创建mysql镜像及运行容器
git clone https://github.com/tutumcloud/tutum-docker-mysql docker build -t tutum/mysql 5.6/ docker run -d MYSQL_PASS="mypass" --name db tutum/mysql
创建php apche镜像及运行容器
git clone https://github.com/tutumcloud/tutum-docker-php docker build -t tutum/apache-php . docker run -d -p 80:80 --link db:mydb -v /app:/app tutum/apache-php
curl http://localhost/*注意mysql容器每次启动的ip是动态分派的。php应用中mysql的ip地址为映射的别名mydb,如需要查看可通过如下命令查看
docker exec db ifconfig
评论(0)