First, configure the environment
[root@docker ~]# systemctl stop firewalld
[root@docker ~]# iptables -F
[root@docker ~]# setenforce 0
Second, the need to upload packages
[root@docker ~]# mkdir docker
[root@docker docker]# unzip compose_lnmp-190606.zip
Third, the deployment docker-compose
[root @ docker ~] # cat centos-7-x86_64.tar.gz | docker import - centos: 7 mirrored into 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
Fifth, the Wordpress put under wwwroot directory
[root@docker docker]# mv wordpress compose_lnmp/wwwroot/
[root@docker docker]# cd compose_lnmp/wwwroot/
[root@docker wwwroot]# ls
index.html index.php wordpress
The docker-compose added to the / usr / local / bin
[root@docker docker]# chmod +x /usr/local/bin/docker-compose #加权限
[root@docker compose_lnmp]# docker-compose up -d #执行
Sixth, test access