解决方法:
在挂载nginx.conf文件时,先将配置文件放在宿主机指定的目录下
如:-v /data/topnginx/nginx.conf:/etc/nginx/nginx.conf
将nginx.conf文件先放在topnginx目录下,再运行docker run文章来源:https://www.toymoban.com/news/detail-604905.html
错误提示:文章来源地址https://www.toymoban.com/news/detail-604905.html
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/data/topnginx/nginx/nginx.conf" to rootfs at "/etc/nginx/nginx.conf": mount /data/topnginx/nginx/nginx.conf:/etc/nginx/nginx.conf (via /proc/self/fd/7), flags: 0x5000: 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部署nginx挂载配置文件报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!