一、配置环境
[root@docker ~]# systemctl stop firewalld
[root@docker ~]# iptables -F
[root@docker ~]# setenforce 0
二、上传需要的软件包
[root@docker ~]# mkdir docker
[root@docker docker]# unzip compose_lnmp-190606.zip
三、部署docker-compose
[root@docker ~]# cat centos-7-x86_64.tar.gz | docker import - centos:7 将镜像导入到docker
[root@docker ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 7 c2705e1a484d 2 days ago 589MB
[root@docker ~]# vim docker/compose_lnmp/nginx/nginx.conf
五、将Wordpress放到wwwroot目录下
[root@docker docker]# mv wordpress compose_lnmp/wwwroot/
[root@docker docker]# cd compose_lnmp/wwwroot/
[root@docker wwwroot]# ls
index.html index.php wordpress
将docker-compose加入到/usr/local/bin
[root@docker docker]# chmod +x /usr/local/bin/docker-compose #加权限
[root@docker compose_lnmp]# docker-compose up -d #执行
六、访问测试