踩坑了,参考Docker 安装 Nginx 容器 (完整详细版)_Touch&的博客-CSDN博客_docker nginx
问题在nginx.conf这个文件上,挂载前需要自己先创建一个
官方也有说从容器中拷贝一个出来:nginx - Official Image | Docker Hub
$ docker run --name tmp-nginx-container -d nginx $ docker cp tmp-nginx-container:/etc/nginx/nginx.conf /host/path/nginx.conf $ docker rm -f tmp-nginx-container
docker cp nginx:/etc/nginx/nginx.conf /home/docker-nginx/conf/nginx.conf docker cp nginx:/etc/nginx/conf.d /home/docker-nginx/conf/conf.d docker cp nginx:/usr/share/nginx/html /home/docker-nginx/
标签:tmp,nginx,手记,conf,home,docker,cp From: https://www.cnblogs.com/fhmsha/p/17017950.html