Let's say I have a Docker container than needs to read and write to an NFS share. There are at least two approaches:
/my/share and then running the container with -v /my/share:/my/data.--opt type=nfs in addition to other parameters needed to identify the share, e.g. --opt o=addr=192.168.1.1,rw etc.Are there any significant advantages using the seconds approach (except ease-of-use) and more specifically, are there any risks or perils connected with the first one?
This question assumes that approach 1 is already used, and that there is a certain cost associated with changing it.
The most obvious advantage would be that: By directly using the NFS backed volume, you can decouple the container and the host.So you can run the same configuration everywhere In case of bind mounting, you are coupling both. So you will have to change your configuration when you move to a different server.
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