3

I'm actually trying to build a dev environment with Docker. So I'm trying to share a folder between my running container and my host system (windows 7).

To run my container I'm using this :

    docker run -d -P -v /c/project/webproject:/usr/src/app chris/node-web-app

This command "works well" and I got the container's ID, but I don't know why my container is stopped. I'm just able to see it by running :

    docker ps -a

I started Docker last weekend during a workshop for its third birthday, so any help will be very useful. Thank you

chrisonstack
  • 175
  • 2
  • 11

2 Answers2

0

/c/project won't be visible in your boot2docker VM.

Only paths started by /c/Users are automatically mounted by the VirtualBox VM.

See "Boot2Docker VirtualBox Guest Additions" if you want to mount another folder.
See "Docker mounting volume for editing source code" for a concrete example.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Thanks for your answer @VonC, but I'm using docker-machine and not Boot2Docker. I found this issue https://github.com/docker/machine/issues/1814

I add the shared folder with the VirtualBox GUI, but when I try to use :

    sudo mount -t vboxsf project /c/project

I got some errors : the option -t doesn't exist...

I also found this doc from docker : https://docs.docker.com/engine/userguide/containers/dockervolumes/#mount-a-host-directory-as-a-data-volume

It still doesn't work for me...

Do you have an idea ?

chrisonstack
  • 175
  • 2
  • 11
  • You *are* using boot2docker: when you do a `docker-machine create -d virtualbox`, docker-machine will download `boot2docker.iso`, a VM image with docker pre-installed. The answer I gave will allow you to modify that image to add one more auto-mounted folder. – VonC Apr 02 '16 at 18:25