Error response from daemon:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/home/nginx/conf/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/64e7f309d45419b26edb70e8ec91d039184b7040c255a3eee92582f2846378f3/merged\\\" at \\\"/var/lib/docker/overlay2/64e7f309d45419b26edb70e8ec91d039184b7040c255a3eee92582f2846378f3/merged/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\"": unknown: 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.

此处原因是nginx.conf是一个文件,但是挂载出去的成为了一个目录导致无法映射成功

Error response from daemon:_第1张图片

解决方法1:把容器生成在主机/home/nginx/nginx.conf中的nginx.conf文件夹替换成nginx.conf配置文件

解决方法2:去掉-v /home/nginx/conf/nginx.conf:/etc/nginx/nginx.conf 参数配置

你可能感兴趣的:(服务器,nginx,docker)