'Docker Prometheus not starting

just on this page described, i'am trying to start on my windows docker prom/prometheus with git-bash:

docker run \
    -p 9090:9090 \
    -v  /C:/Users/Bob/service/src/main/resource/prometheus.yml:/etc/prometheus/prometheus.yml \
    prom/prometheus

but i get this error:

Error response from daemon: Ports are not available: listen tcp 0.0.0.0:9090: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted

docker ps -a:

CONTAINER ID    IMAGE            COMMAND                  CREATED        STATUS   PORTS  NAMES             
4acfd919e0b5    prom/prometheus  "/bin/prometheus --c" 4 seconds ago  Created         brunell  

So why i can not start it on my windows docker ?



Solution 1:[1]

At first sight I have notice that you have written the frontslash / in stead of backslash\ in the prometheus.yml path on Windows.

It must be: -v C:\Users\Bob\service\src\main\resource\prometheus.yml

Also, at the beginning of the path, is not necessary to put any slash. Typping -v C:\... it should work.

If this doesn't work try to add more memmory to docker.

Hope this could help you!

Greetings :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1