You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker运行Prometheus挂载自定义yml失败:OCI runtime创建错误

问题解决步骤

核心错误原因

你使用的主机路径/tmp/prometheus.yml与实际文件所在的D:\Projects\Msc-Thesis-Project\tmp路径不匹配,且Windows环境下Docker挂载文件需要特定路径格式,导致Docker无法定位到目标文件,触发了“挂载类型不匹配”的错误。

修正后的命令

根据你使用的终端环境,选择对应命令执行:

1. Git Bash/WSL终端

将Windows盘符转为小写,反斜杠替换为斜杠:

docker run --net=host \
-v /d/Projects/Msc-Thesis-Project/tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus

2. PowerShell/CMD终端

用引号包裹路径,保留Windows路径格式:

docker run --net=host `
-v "D:/Projects/Msc-Thesis-Project/tmp/prometheus.yml:/etc/prometheus/prometheus.yml" `
prom/prometheus

额外检查项

  • 确认prometheus.yml文件确实存在于D:\Projects\Msc-Thesis-Project\tmp目录下,文件名无拼写错误(容器内路径区分大小写,尽量保持文件名一致)。
  • 打开Docker Desktop设置,进入Resources -> File Sharing,勾选D盘,保存后重启Docker,确保Docker有权限访问该路径下的文件。

内容的提问来源于stack exchange,提问作者Alex_Pap

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 10:41:18