0

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.

user3758291
  • 129
  • 1
  • 8

1 Answers1

1

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/

Adrian Mouat
  • 44,585
  • 16
  • 110
  • 102