1

I have a running docker container that uses volume mounting and NFS to store data in another machine.

Now I want to map this volume to a new folder in the filesystem of a new machine.

shall I do bind mounting in the container to the new VM location like this <VM_IP>:/path_to_folder is that possible?

or is there a way to make the existing volume always uses that new folder as a reference instead of the NFS?

Thank you!

NesuGH
  • 79
  • 1
  • 2
  • 12
  • The answers to the linked question have both Compose and plain `docker volume create` commands. You do need to go through a couple of steps to make Docker mount a remote drive; you can't just drop the NFS server's IP address in a `docker run -v` option. – David Maze Sep 30 '20 at 14:15
  • actually, I don't want to use NFS I already have it, i want to bind mount to a folder in another machine – NesuGH Sep 30 '20 at 15:13
  • You can't. You need to use something like NFS or some other sort of network-accessible storage, or mount something like an sshfs on the system running the container. – David Maze Sep 30 '20 at 15:27
  • Thank you David got it, I think using SSHFS with a daily cron job will solve the issue – NesuGH Oct 01 '20 at 08:19

0 Answers0