docker创建nginx容器出问题

命令:docker run -p 80:80 --name mynginx -v $PWD/www:/www -v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf -v $PWD/logs:/wwwlogs  -d nginx
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 \\\"/root/conf/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/0d3bc40b3dbdaeaa49ca1fe50f5e4fac7a265066cb9a7eff4202b1aa5d0abdcf/merged\\\" at \\\"/var/lib/docker/overlay2/0d3bc40b3dbdaeaa49ca1fe50f5e4fac7a265066cb9a7eff4202b1aa5d0abdcf/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.

这个问题怎么解决?

阅读 6.1k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题