Volumes

The Docker volume command works just like the “-v” command line parameter we saw in Chapter 2, with the left side of the colon (:) representing the Windows/OSX/Linux directory to mount and the right side representing the destination directory inside the Docker container. Your source code from Windows/OSX/Linux is available to the VirtualBox Linux Docker host using the shared folder feature. It is then further shared from the Docker host to the container using the volume command. As shown below, VirtualBox shared folders convert “C:\” into /c/ and convert all Windows path backslashes into Linux-compatible forward slashes. For example, here are the before and after directories for our source code in the Docker host:

Windows Path

Get Microservices with Docker on Microsoft Azure™ (includes Content Update Program) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.