Mounted Windows Network Drive using WSL is not visible in Docker for Desktop CLI terminal

Hello there,

I am using WSL2 and Docker Desktop for Windows.

I managed to “successfully” mount my network drive using WSL bash terminal like this:

cd /etc
sudo chmod -R 777 fstab
echo "////www-testdrive//data-users//mydata /media/data-users drvfs dom=teralab,user=johnny,vers=2.0,nobrl,cache=none,echo_interval=1,actimeo=0,rsize=1024 0 0" >> fstab

Those lines above allowed me to call sudo mount -a after I start my WSL which mounts my network drive.

When I execute cd /media/data-users and ls, I can see all my files from the mounted network drive.

So far, so good.

The problem is, if I run my Docker container in WSL terminal docker-compose up, everything seems OK, but if I go to the Docker Desktop for Windows and open container’s CLI terminal I cannot see any of my files from the network drive - the directory /media is completely empty after executing cd /media & ls.

I think, I might have some problem with mapping in my docker-compose.yml, because I can only see mounted files in WSL terminal, but not in container’s CLI terminal in the Docker Desktop app.

Here’s my docker-compose.yml:

version: '3.8'

    image: ''
      - /media/data-users/:/data-users:rw
      - /mnt/c/dev/common:/common
      - /mnt/c/dev/robot:/web
      - ./logs:/var/log/apache2
      - ./logs:/var/log/php
      - ./apache2:/usr/local/apache2/conf:ro
      - ./odbcinst.ini:/etc/odbcinst.ini:ro
      - ./php:/usr/local/etc
      - ./msmtp/msmtprc:/etc/msmtprc:ro
      - http_proxy=
      - https_proxy=
      - APACHE_RUN_USER=www-data
      - APACHE_RUN_GROUP=www-data
      - APACHE_PID_FILE=/run/
      - web
    labels: &apache_labels_default
      - "traefik.enable=true"
      - "traefik.http.routers.robot-johnny-teralab-com.rule=Host(``)"
      - "traefik.http.routers.robot-johnny-teralab-com.tls=true"
      - ""
      replicas: 1
          - node.role == manager
      labels: *apache_labels_default
    user: "1000:www-data"

    external: true

Pls help.

Hey did you get this figured out? I’m having the same issue and have been unable to mount Windows-host network drives as volumes in my docker containers