I am using the (not official, as mentioned by Usman) mongodb image (https://registry.hub.docker.com/u/dockerfile/mongodb/) which creates a volume at "/data/db"
create mongdb container:
docker build -t="dockerfile/mongodb" github.com/dockerfile/mongodb
Run data container:
docker run -v /data/db --name databox ubuntu:latest true
run mongdb container with the data container (write mongo data into data container)
docker run -d -p 27017:27017 --volumes-from databox --name mongodb_shared_persistence dockerfile/mongodb
I tested it with:
docker run --volumes-from=databox busybox ls /data/db
...db files are created. So far so good.
But what if the data container has a volume at /mongodb/data and I want to map that to the /data/db volume of the mongodb container?
...like this:
docker run -d -p 27017:27017 -v <?data_container_volume?>:/data/db --name mongodb dockerfile/mongodb
is that even possible?
If you read the comments by shykes on Issue 111:
So I don't think there is any way to achieve this.