问题
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.
- Open Docker for Windows Settings.
- On Shared Drives tab click Reset credentials...
- Share your drive once again.
来源:https://stackoverflow.com/questions/48380574/invalid-mount-config-for-type-bind-bind-source-path-does-not-exist-when-tryin