docker-compose with MongoDb and volumes - doesn't seem to be mounted -


i'm trying run docker-compose operation spawns redis , mongodb instance , (should) provide mongodb instance data-file host pc through volumes specification.

i can boot container using following docker-compose.yml:

redis:   image: redis   ports:    - "6379:6379" mongo:     image: mongo:latest   volumes:     - ./data/db:/data/db   ports:     - "27017:27017"   command: --rest 

assuming should 'mount' directory data/db of data dir next docker-compose.exe file.

enter image description here

i can connect both redis , mongodb, simple query on collection performing count() returns 0 (which should contain data). leads me believe mounting of volumes property isn't working.

if check file structure on container don't see /data folder... am missing here... lead!

enter image description here

what showing filesystem of boot2docker, tinycore-based linux host runs docker daemon.
not:

and works if files in c:\users\... or /users/..., host folder mounted virtualbox in linux vm.

to check if mount has taken place, docker exec mongo bash, open bash in container , check ls /data.


Comments