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?
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.
You may run into this on Windows after you change your Windows account password.
i got same error happened to me. as below picture, uncheck "Use Docker Compose V2" and it works for me. I wanted to share in case this might be the solution for somebody
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With