首页 > 开发 > 云计算 > 正文

docker开启nginx容器出现错误

2017-09-12 09:50:28  来源: 网友分享

利用docker开启一个nginx容器出现错误。
我在linux终端执行的指令是$ docker run -p 8050:80 --name mynginx -v $PWD/www:/www -v $PWD/conf/nginx/nginx.conf:/etc/nginx/nginx.conf -v $PWD/logs:/wwwlogs -d nginx

出现的错误是:
docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused "rootfs_linux.go:57: mounting \"/root/conf/nginx/nginx.conf\" to rootfs \"/var/lib/docker/aufs/mnt/edd3b9a8923f13404d42aa73f509b625c7370791c825424427eacae6432fecc8\" at \"/var/lib/docker/aufs/mnt/edd3b9a8923f13404d42aa73f509b625c7370791c825424427eacae6432fecc8/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.
错误截图

求大神解答,搜索了很多可是依旧没有找到答案。

解决方案

再读一遍。