配置文件地址:
https://github.com/how2dock/docbook/tree/master/ch01/supervisor
建立wordpress目录,按配置文件地址建3个文件:
Dockerfile (保护数据库密码)
Supervisord.conf
wp-config.php
cd wordpress
建立镜像:
docker build -t wordpress .
运行容器:
docker run –d –p 80:80 wordpress
网页可以访问这个ip:
http://xxx:80
下载一个工具:
wget -P ~ https://github.com/yeasy/docker_practice/raw/master/_local/.bashrc_docker;
echo "[ -f ~/.bashrc_docker ] && . ~/.bashrc_docker" >> ~/.bashrc; source ~/.bashrc
利用工具docker-enter进入容器:
docker-enter b98d252eb7f6 /bin/bash
docker ps –a 查出容器id
进入容器mysql
docker-enter b98d252eb7f6 mysql -uroot -p