Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafarocha/3a8abe64137344765779a96325834e47 to your computer and use it in GitHub Desktop.
Save rafarocha/3a8abe64137344765779a96325834e47 to your computer and use it in GitHub Desktop.
docker error when mount directory filepath absolute name

command

docker run -d -p 9090:9090 -v /Volumes/work/github/demo-micrometer/src/main/resources/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

error

rocha$ docker run -d -p 9090:9090 -v /Volumes/work/github/demo-micrometer/src/main/resources/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
3d2482a583fad258fd2ed6e6cfda18d54c16bd7cf12508d00fb07d7ff3ae61b6
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/Volumes/work/github/demo-micrometer/src/main/resources/prometheus.yml\\\" to rootfs \\\"/mnt/sda1/var/lib/docker/overlay2/d136b936f1a0f291eb0b24b647bfc3671fdc9a71bbdf02cc90e46c84c295d9c7/merged\\\" at \\\"/mnt/sda1/var/lib/docker/overlay2/d136b936f1a0f291eb0b24b647bfc3671fdc9a71bbdf02cc90e46c84c295d9c7/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.

workaround

ir ao diretorio ou arquivo prometheus deve estar no mesmo diretorio

solucao

-v prometheus.yml:/etc/prometheus/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment