Introduction
WSL and Docker client have been now around for quite some time. Crazy people like me, even got them working together.
Of course, the initial thought was to install the Docker daemon on WSL, and we very rapidly got to the conclusion that it was not possible right now.
Now, while doing some tests, I came to one situation that might be interesting/helpful to know: when mounting a path from WSL, actually what is being mounted is actually ... something else!
The Facts
Before I go into the demo, please remember "how" everything is being connected together.
Components:
- Docker daemon running inside MobyLinuxVM on Hyper-V
- Docker client running inside WSL on pProcess (port 2375 exported)
- Docker Proxy (1.12 beta) that actually manages the communication from the Docker Clients to the Docker Daemon(s)
Demo:
Ok, enough with the theory, here is the demo. I split it in 2 distinct containers.
Phase 1 - First Container
- [WSL] Create a directory and a file inside it
- [WSL] Run a new Ubuntu container with the directory mounted
- [Docker] List the content of the directory mounted
- [Docker] Create a file inside the mounted directory
- [Docker] Exit the container
Phase 2 - Second Container
- [WSL] Run a new Ubuntu container with the directory mounted
- [Docker] List the content of the directory mounted
- [Docker] Exit the container
Conclusion
Actually, the really intelligent persons working @Docker, blocked the capabilities of the mounts (of course, SECURITY FIRST!)
So, if someone too curious tries to mount a system FS (i.e. root for fun), then here is what can be seen:
Hopefully, in the future, even WSL mounts will be possible.