问题
在Ubuntu上搭建prometheus时,一直提示下面这个错误,启动不起来
报错信息
错误信息:
2a3b27ed7a03663954217c078e92053118d1c3ac03ff8f61bc04f92a7df57aaa
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused “process_linux.go:430: container init caused “rootfs_linux.go:58: mounting \”/home/hongli/prometheus.yml\” to rootfs \"/var/lib/docker/overlay2/64576deb298b98977483b5e920027cccaec4c1f05352f0f25bbdd77713e2d42d/merged\" at \"/var/lib/docker/overlay2/64576deb298b98977483b5e920027cccaec4c1f05352f0f25bbdd77713e2d42d/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.
使用 docker start prometheus启动也是这个错误
安装命令:
docker run -d --name prometheus --network grafana -p 9090:9090 -v ${PWD}/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus:v2.16.0 --config.file=/etc/prometheus/prometheus.yml
环境
Ubuntu 16.04