I’m new to docker and containerization concepts; the task at hand requires me to explore potential options where a NFS share can be mounted directly into a docker run container BYPASSING the host completely i.e. host would not know anything about the NFS share(s) mounted in any container hosted on it.
One option I discovered googling on the web is as follows:
- Launch docker container with ‘–privileged=true’ flag.
- Install nfs-utils for *nix based container images.
- mount the share inside the container using usual *nix mount command; for-instance:
“mount -t nfs example.tw:/target/ /srv -o nolock”
Few questions I wanted advice on:
- Is there a way to achieve this WITHOUT launching the container in ‘privileged’ mode?
- Does the solution works fine for containers running Windows images?
- Are there better ways to achieve the same?