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).

  • Port forwarding issues trying to run a docker container
  • Cannot connect to redis running as container with boot2docker
  • Node http-proxy in Docker container
  • Docker Rest Apis using node.js
  • Docker container change behaviour on different hosts
  • docker-compose: postgres data not persisting
  • I cannot tell from the Docker reference what is the best way of automating this process.

  • Dockerfile Automated Build from Github- Tag not found
  • Pecl doesn't work in php:7.0-fpm image
  • Docker 'killing' my program
  • Why is my npm dockerfile looping?
  • Can't connect to ElasticSearch Docker cluster which run on local virtual machine using Java API
  • Docker vs. Rocket in development
  • 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/

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.