1、获取docker镜像
2、创建nginx容器
vim /opt/nginx/Dockerfile
vim /opt/nginx/nginx.conf
创建nginx镜像(注意最后有个点,不可省略)
docker build -t nginx:lnmp .
docker images
启动nginx容器并且为容器指定IP地址
docker run -d --name nginx -p 80:80 -m 500m --memory-swap 1g --ip 172.17.0.2 nginx:lnmp
3、创建mysql容器
vim /opt/mysql/Dockerfile