alairock
alairock

Reputation: 1934

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

Upvotes: 4

Views: 9140

Answers (1)

herm
herm

Reputation: 16305

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

Upvotes: 3

Related Questions