1

Having a docker database container, in this case a neo4j container, how can I persist the data, and make sure that the next time I start a neo4j docker image that it points to my HOST database and not a new database?

I am using Docker in windows, so boot2docker is being used. And I say database but I am also thinking how do I serve a directory that I am working on a web application to be run, so I don't have to commit all the changes to the image... I just want to edit a folder in my windows environment and debug it using a docker web server stack.

Astronaut
  • 6,691
  • 18
  • 61
  • 99

1 Answers1

3

The easiest way would be to have a shared folder between your Windows host and boot2docker VM (This post can help)

Then you just have to share that folder to your container using the -v option.

docker run -d -v /path/to/shared/folder/in/VM:/path/to/folder/in/container myimage /cmd

More info on how to share data between container and host

Community
  • 1
  • 1
Regan
  • 8,231
  • 5
  • 23
  • 23
  • Is there any way not having to use Guest Additions? i.e. without having to use a different docker iso? I really can't understand why docker does not provide an easy way to do this. – Astronaut Sep 15 '14 at 10:02
  • Found this by doing a bit of research : http://www.incrediblemolk.com/sharing-a-windows-folder-with-the-boot2docker-vm/ Does it do what you want ? – Regan Sep 15 '14 at 12:34
  • That definitely helped, still its "crazy" that this is so hard to setup in Windows HOST env. – Astronaut Sep 16 '14 at 20:42
  • I'm using the samba shares as recommended by the docker team, it's fairly easy to set up https://gist.github.com/so0k/d4f5e485a81ca5768643 the docker team is working on 'boot2docker share' command which would expose a folder from the windows/osx host to the boot2docker VM using sshfs. I'm using robocopy mirroring to sync my local folder with the remote folder, but it's too slow, I hope to use unison or something similar soon – Vincent De Smet Sep 20 '14 at 05:01