Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16300

Docker volume --mount command is not working

$
0
0

I am trying to create a docker volume of mongo that can be used even after a container is deleted. The volume works with the command

docker run -d --name mongo-local -p 27017:27017 -v mongo-local:/data/db mongo.

However when I try to use the mount command

docker run -d --name mongo-local -p 27017:27017 --mount source=mongo-local,target=/data/db mongo

it shows the following error

 Error response from daemon: invalid mount config for type "volume": invalid mount path: 'C:/Program Files/Git/data/db' mount path must be absolute.See 'docker run --help'.

I already have a volume created with the name mongo-local so that's not an issue. Why am I facing the error?

Edit:

Tried the answer of @BMitch, but still the same error.

error image

docker volume


Viewing all articles
Browse latest Browse all 16300

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>