利用docker開(kāi)啟一個(gè)nginx容器出現(xiàn)錯(cuò)誤。我在linux終端執(zhí)行的指令是$ 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出現(xiàn)的錯(cuò)誤是: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.錯(cuò)誤截圖求大神解答,搜索了很多可是依舊沒(méi)有找到答案。
2 回答

青春有我
TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超8個(gè)贊
docker不提倡將一文件掛載到容器文件夾中,報(bào)錯(cuò)的原因可能是因?yàn)槿萜髦?etc/nginx/nginx.conf文件存在,不能創(chuàng)建出該文件夾來(lái),把/etc/nginx后邊的nginx.conf去掉試試看
- 2 回答
- 0 關(guān)注
- 2083 瀏覽
添加回答
舉報(bào)
0/150
提交
取消