Skip to content

Instantly share code, notes, and snippets.

@drobbins
Last active August 29, 2015 14:10
Show Gist options
  • Save drobbins/0aa0743ff80733a4e5e9 to your computer and use it in GitHub Desktop.
Save drobbins/0aa0743ff80733a4e5e9 to your computer and use it in GitHub Desktop.
Dockerfile for Boot2Docker Volume Sharing?

Dockerfile for Boot2Docker Volume Sharing in Windows

My goal here is to have a docker-encapsulated Yeoman development environment, and yet be able to edit the files from my Windows editor(s).

From an SSH in Boot2Docker (from the /home/docker/projects directory):

  1. Build the Image

    $ mdkir image && cd image
    # Do whatever to create the included Dockerfile
    # e.g. curl -O https://gist.githubusercontent.com/drobbins/0aa0743ff80733a4e5e9/raw/f5c5bb55818ab372ab8f15c8bb5e68c1127cb382/Dockerfile
    $ docker build -t yeodev .
  2. Start the Container

    $ cd .. && mkdir myapp && cd myapp
    $ docker run -itP -v /home/docker/projects/myapp:/home/user/application yeodev

This should put you in a shell from which you can generate your app (e.g. yo angular --coffee myapp) and also run the various grunt tasks (e.g. grunt test or grunt serve).

FROM codenvy/angular-yeoman
# Change the user ID and group to be compatible with Boot2Docker
RUN sudo usermod -g staff user && sudo usermod -u 1000 user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment