1.拉取mysql
docker pull mysql
2.拉取wordpress
docker pull wordpress
3.启动mysql
docker run -d --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -v /data/mysql_data:/var/lib/mysql mysql:latest
4.启动wordpress
docker run -d --name wordpress -v /data/wordpress_data:/var/www/html -e WORDPRESS_DB_HOST:mysql -e WORDPRESS_DB_USER:root -e WORDPRESS_DB_PASSWORD:123456 -e WORDPRESS_DB_NAME:wordpress --link mysql:mysql -p 8090:80 wordpress
5.访问wordpress
http://localhost:8090/
标签:部署,DB,WORDPRESS,mysql,wordpress,docker,data From: https://www.cnblogs.com/hillman01/p/17275623.html