简体   繁体   中英

NFS Volumes in Docker/Docker-Compose

I'm using boot2mac and docker-compose. I want to be able to configure this to mount my volume via NFS. This is my configuration:

web:
  image: nginx
  links:
    - db
  ports:
    - "80:80"
  volumes:
    - .:/usr/share/nginx/html
db:
    image: postgres

To define an nfs volume in a compose file do as described in this thread :

volumes:
  name:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.1,rw
      device: ":/path/to/dir"

This is supported since at least composefile version 2

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