Share nfs volume docker swarm


//Docker stack

version: "3.7"
services:
  web:
    image: nginx
    volumes:
      - nginx.vol:/usr/share/nginx/html
    ports:
      - 80:80
    networks:
      - web

networks:
  web:
    driver: overlay
    name: web

volumes:
  nginx.vol:
    driver: local
    driver_opts:
      type: "nfs"
      o: addr=192.168.0.13,nolock,soft,rw
      device: ":/media/fdisk"


// nfs setting /etc/exports

/media/fdisk *(rw,insecure,sync,no_subtree_check,no_root_squash)


I had problem with nfs share if i use vfat partition, and i change to ext4 for partition usb fdisk and now all volumen working properly (dont forget to change media share to 777 if you have problem to read and write)

Source :

https://pimylifeup.com/raspberry-pi-nfs/

https://sysadmins.co.za/docker-swarm-persistent-storage-with-nfs/

https://linuxize.com/post/how-to-mount-an-nfs-share-in-linux/

https://serverfault.com/questions/212178/chown-on-a-mounted-nfs-partition-gives-operation-not-permitted

One thought on “Share nfs volume docker swarm

  1. Pingback: Install node-red in docker swarm with share data in nfs – kak eko

Ditunggu komennya ...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.