[root@localhost n1]# docker run -it -d --name n1 -v /home/n1/nginx.conf:/etc/nginx/nginx.conf --net=host --privileged nginx
5e3388d14ae0cb37f12667a685cf8a76b86af8926c185f4277688e24563f8327
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:364: container init caused \"rootfs_linux.go:54: mounting \\\"/home/n1/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/2b97634b2e49e7d3c48cc16dd7b9e367179d8edaf9c1257b24dfca761211a069/merged\\\" at \\\"/var/lib/docker/overlay2/2b97634b2e49e7d3c48cc16dd7b9e367179d8edaf9c1257b24dfca761211a069/merged/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
另一个问题是生产环境是不是一般用拷贝文件比映射文件要好