persist and share data from docker mongo container (with docker)

Need a push in the right direction with this one.

I want to “dev0ps” the workflow of our local development with docker.
As best practice our mongodb should run in a seperate container, having a volume attached and working. (this part checks out fine)

  • how to extend docker mysql image
  • Docker on the mac separates internal and external file ownerships; not so on linux
  • Why can't I extend docker postgres image to create extra database and user
  • Mount host directory with a symbolic link inside in docker container
  • Concourse add file to docker image just once
  • Would using Docker (Docker Swarm) grant any additional benefits when making an N node Raspberry Pi cluster web server?
  • Our developers should then keep the data in sync, so its able to be “pushed & pulled”.

    Can i achieve this with git? (The data folder is around 500mb, but this is just a fresh project)

    Should i write a script that performs a mongodump and upload it (to git?)?

    Should i consider spinning up a mongodb server of my own, where they push and pull from?

    thanks in advance!

  • Lack of docker-current file cause docker service cannot be start in Centos 7
  • Docker not able to connect via host IP or localhost
  • Installing PostgreSQL within a docker container
  • To understand ENTRYPOINT in docker
  • docker out of disk space
  • Installing libraries in ubuntu image using Docker
  • One Solution collect form web for “persist and share data from docker mongo container (with docker)”

    I see what you’re trying to achieve, but I don’t think the best approach is to keep neither the data from one local working copy in sync inside Git, as this is likely to provide inconsistencies in the Database if Developers have different copies of the data.

    The best thing you could do is have a set of Fixtures (Application Data inside the MongoDB database) which is inserted and deleted via your code, that way you control what goes inside the database and what does not, That data can very well be included in the Git repository in a folder called fixtures or database.

    You could also have different sets of data, one for developing, one for testing, etc. As you can see you can make it as complex or complementary as possible.

    I’ve been using this approach for more than one year and has not presented any problems.

    Let me know if you have any concerns about this approach.

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