启动容器
docker run -d --name nginx \-v /etc/local/nginx/dist:/usr/share/nginx/html \-p 80:80 \--restart always \nginx
宿主机站点 /etc/local/nginx/dist
容器内html /usr/share/nginx/html
复制配置文件到主机
docker cp nginx:/etc/nginx/nginx.conf /etc/local/nginx/nginx.conf
停止容器
docker stop nginx
修改为配置文件后重新挂载
挂载配置文件
docker run -d --name nginx \-v /etc/local/nginx/nginx.conf:/etc/nginx/nginx.conf \-v /etc/local/nginx/dist:/usr/share/nginx/html \-p 80:80 \--restart always \nginx