Invalid mount config for type “bind”: bind source path does not exist when trying to run container on Docker for Windows

北慕城南 提交于 2020-01-13 00:30:35

问题


I'm trying to run the Prometheus sample at https://docs.docker.com/engine/admin/prometheus/#use-prometheus using Docker on Windows. I'm executing the following command:

docker service create --replicas 1 --name my-prometheus `
   --mount type=bind,source="C:/temp/prometheus.yml",destination=/etc/prometheus/prometheus.yml `
   --publish published=9090,target=9090,protocol=tcp `
   prom/prometheus

The error is: invalid mount config for type "bind": bind source path does not exist

I'm pretty certain the file exists (Test-Path with PowerShell returns true).

Any idea what I'm doing wrong?

Update

Running the same command with mount type = volume gives me the following error:

C:/temp/prometheus.yml" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path"

I am passing an host directory and "C:/temp/prometheus.yml" is an absolute path.


回答1:


You may run into this on Windows after you change your Windows account password.

  1. Open Docker for Windows Settings.
  2. On Shared Drives tab click Reset credentials...
  3. Share your drive once again.


来源:https://stackoverflow.com/questions/48380574/invalid-mount-config-for-type-bind-bind-source-path-does-not-exist-when-tryin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!