How to use WSL2 ubuntu filesystem in a Docker Compose Bind mount in Windows

Viewed 573

I'm using Windows 10 with WSL 2 and Docker. I've a Docker Compose in the windows filesystem and I want to create a bind mount using my files hosted in the Ubuntu WSL2.

I've tried the bellow settings but no lucky. When I try to docker compose up the docker bugs, probably because the wls$ sys variable.

volumes:
    app_files: 
        driver: local
        driver_opts:
            type: none
            o: bind            
            device: "//wsl$/Ubuntu-20.04/home/dev/app       

Is it possible to set the docker-compose.yml to bind the content inside the WSL 2 distro? Someone knows how to do it?

Thank you

0 Answers
Related