Docker Container can't see files in cifs volume mount

Becky Breeden 6 Reputation points
2022-04-20T22:04:02.087+00:00

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?

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,530 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,266 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,336 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--

    0 comments No comments

  2. Becky Breeden 6 Reputation points
    2022-04-26T21:16:54.893+00:00

    I added --privileged to the docker run command and still cannot see the files in the mount.

    0 comments No comments