1.安装nginx
docker run -p 80:80 --name nginx -d nginx:1.10
2.将nginx容器里的配置拷贝到当前目录
mkdir -p /mydata/nginx
cd /mydata
docker container cp nginx:/etc/nginx .
docker stop nginx
docker rm nginx
mv nginx conf
mkdir nginx
mv conf nginx
docker run -p 80:80 --name nginx \
-v /mydata/nginx/html:/usr/share/nginx/html \
-v /mydata/nginx/logs:/var/log/nginx \
-v /mydata/nginx/conf:/etc/nginx \
-d nginx:1.10
重启自启动
docker update nginx --restart=always