boot2docker: Add volume from windows host to the docker container

boot2docker is great. It allows us to develop using docker even on Windows PCs. One feature that is totally awesome is its ability to share folders on windows host with boot2docker virtual box image. This shared folder from windows can then be used as a volume in the docker containers.

The first part is available to you out of the box. boot2docker shares the c:\User directory with the boot2docker virtualbox image and mounts it under /c/. Yay!

You can add this folder or part of it to the docker container as you would with normal folders.

docker run -it -v /c/:/data/ : bash

This will add the whole C:\User under /data in the launched docker container.