docker-compose.yml
db:
image: mongo:3
volumes:
- ./mongo_data:/data/db
This works locally, with files being stored on the host at /data/db.
With docker-machine on macOS I get the following error:
db_1 | 2017-02-03T10:16:14.839+0000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
/data/db is on the mongo image, so I’m a bit confused as to why that would be different.
ETA: Seems to be something to do with the volumes mount.