'Where on the host can I find Docker bind mounts that are expected to be on a network drive?

I'm running Windows 10 with WSL2 and a network drive, H:.

When I run a Docker container with bind mounts to a location on the local C: drive, everything works as expected: data written to that location in the container appears locally on C:, and new files in C: appear in the container.

Here, Docker was started using PowerShell with C:\Users\Username\Documents\Scripts\R_Docker_Testing as the working directory and the .\volume_data directory already existing.

PS C:\Users\Userame\Documents\Scripts\R_Docker_Testing> docker run -it -v "$(pwd)\volume_data:/home/app/data" test-r bash

When I switch to a directory on the H: drive, H:\Username\R_Docker_Testing, the same command executes and works properly, except that there appears to be no communication between the H: drive and the container.

PS H:\Username\R_Docker_Testing> docker run -it -v "$(pwd)\volume_data:/home/app/data" test-r bash

Files written in the container will persist across containers, but do not appear in H:\Username\R_Docker_Testing\volume_data. Similarly, files already existing inside H:\Username\R_Docker_Testing\volume_data are not found in the container.

Docker does not appear to be creating a volume:

PS H:\> docker volume ls
DRIVER    VOLUME NAME
PS H:\>
PS H:\> docker inspect -f '{{ .Mounts }}' 264
[{bind  H:\Username\R_Docker_Testing\volume_data /home/app/data   true rprivate}]
PS H:\> docker inspect <container-id>
.
.
        "Mounts": [
            {
                "Type": "bind",
                "Source": "H:\\Username\\R_Docker_Testing\\volume_data",
                "Destination": "/home/app/data",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
.
.

My question is: Where are these files being stored on the host so that they persist across containers?

Here's my Dockerfile:

FROM r-base:latest
RUN mkdir -p /home/app/scripts
RUN mkdir -p /home/app/data
RUN install2.r --error --skipinstalled --ncpu 1 here
COPY .here /home/app
WORKDIR /home/app
COPY Simple_script.R ./scripts/

This question seems relevant: Docker on WSL won't bind mount $HOME



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source