Creating a bootstrap Dockerfile that automatically exposes files to the host operating system
I’m trying to create a bootstrap Dockerfile for web development.
I would like any containers to allow for access of my code from within and also from the host operating system (Mac OS X).
I cannot tell from the Docker reference what is the best way of automating this process.
One Solution collect form web for “Creating a bootstrap Dockerfile that automatically exposes files to the host operating system”
Use a volume that mounts the code on the host into the container e.g:
docker run -d -v /Users/me/code:/code IMAGE
You should now find the
/Users/me/code is accessible at
/code in the container. The boot2docker VM has shared your home directory, so there should be no problem mounting a volume from there.
Refer to the official docs for more information: https://docs.docker.com/userguide/dockervolumes/