简体   繁体   中英

Docker-compose works locally but not with docker-machine

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: It's something to do with the volume mount.

It's the volume mount, for whatever reason.

I'll move on and find another method for backing up data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM