I added --privileged to the docker run command and still cannot see the files in the mount.
Docker Container can't see files in cifs volume mount
I am using Docker Desktop 4.7.0 and wsl2.
At the wsl cli, I am able to mount a cifs share to '/mnt/drnsf1/ims212' successfully. Running 'ls' in the /mnt/drnfs1/ims21 directory in wsl cli, shows all the files.
I mount the volume into the container by using docker run -v /mnt/drnfs/ims212 : /mnt/drnfs/ims212 . When I am in the container interactively and navigate to the /mnt/drnfs1/ims212 directory and run 'ls' there are no files.
I have worked on this issue all last week, 8 hours a day, and this week 8 hours a day, and into the night.
Is Docker Desktop running on wsl2 incapable of mounting cifs volumes?
2 answers
Sort by: Newest
-
-
Limitless Technology 39,356 Reputation points
2022-04-26T10:28:55.55+00:00 Hi BeckyBreeden-9339,
Docker is preventing you from mounting a remote volume inside the container as a security measure. If you trust your images and the people who run them, then you can use the --privileged flag with docker run to disable these security measures.
Further, you can combine --cap-add and --cap-drop to give the container only the capabilities that it actually needs. (See documentation) The SYS_ADMIN capability is the one that grants mount privileges.
--If the reply is helpful, please Upvote and Accept as answer--