docker挂载容器报错: Error response from daemon: OCI runtime create failed: container_linux.go:380

docker挂载nginx报错
在这里插入图片描述
原因就是外部文件没有创建,启动失败
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting “/mydata/nginx/conf.d/default.conf” to rootfs at “/etc/nginx/conf.d/default.conf” caused: mount through procfd: 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.

格外注意的是,宿主机文件夹和文件先要创建好

你可能感兴趣的:(docker)