0

How to mount a docker volume from inside the container inside local directory with docker run command .

I was trying the -v option but seems it mounts the current working directory into the container.

https://docs.docker.com/engine/reference/commandline/run/#volume

       -v  /localdatadir:/containerdatadir

The volume inside my container is a database volume and we want it to be available on the local directory .

Any suggestions ?

Zama Ques
  • 1,497
  • 5
  • 26
  • 45
  • You can't directly access a named volume's content from the host, or mount an arbitrary container directory to the host. Mounts always take external content and hide the image's contents at that path. – David Maze Feb 03 '23 at 11:59

0 Answers0