prometheus-book icon indicating copy to clipboard operation
prometheus-book copied to clipboard

docker安装prometheus有误

Open troub1emaker0911 opened this issue 4 years ago • 2 comments

您好! 采用你的命令安装,一直提示如下错误: [root@vm-ecs-104 ~]# docker run -p 9090:9090 -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/etc/prometheus/prometheus.yml\\\" to rootfs \\\"/var/lib/docker/overlay2/2101fbe118b3d1f5c38d83fa80464e53a0aa1851089dcce978525f815c66c80d/merged\\\" at \\\"/var/lib/docker/overlay2/2101fbe118b3d1f5c38d83fa80464e53a0aa1851089dcce978525f815c66c80d/merged/etc/prometheus/prometheus.yml\\\" caused \\\"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.

查看了本机的/etc/prometheus目录,发现prometheus.yaml被创建成了目录,而不是文件。建议修改下。

另:推荐还是用Linux系统演示,发现好多都是MacOS的安装包。

troub1emaker0911 avatar Nov 27 '20 09:11 troub1emaker0911

同样遇到了这个问题

moxuec avatar Jan 27 '21 01:01 moxuec

应该是要先创建配置文件, 然后采用docker挂载,否则会创建成文件夹

lautumn1990 avatar Jul 07 '21 08:07 lautumn1990