Sign inSign up

prologic/docker-volume-nfs

By prologic

Updated over 4 years ago

Docker Volume Plugin for NFS with support for "Managed Volumes".

Plugin
0

1.8K

prologic/docker-volume-nfs repository overview

docker-volume-nfs

Docker Volume Plugin for NFS with support for "Managed Volumes".

"Managed Volumes" here means that once a NFS Export has been mounted via the plugin and MANAGE_VOLUMES is set to true (on plugin initialization), the plugin will perform the following actions:

  • When a Docker client requests a volume by <name>,
  • The docker-volume-nfs plugin will create /mnt/nfs/root/<name>
  • Then bind mount (via mount --bind) /mnt/nfs/root/<naem> to /mnt/nfs/volumes/<name>.

This basically "emulates" a volume-like behaviour that is transparent to Docker clients and provides a "view" of a single directory on the NFS exported share (a "volume") to the client and is mounted into the container.

Usage

NFS Volumes:

$ docker plugin install --alias nfs --grant-all-permissions prologic/docker-volume-nfs
$ docker volume create -d nfs -o src=nfshost:/export/path nfsvol
$ docker run -i -t --rm -v nfsvol:/data alpine ls /data

NFS Docker Managed Volumes:

docker plugin install --alias nfs --grant-all-permissions prologic/docker-volume-nfs HOST=<nfshost> MANAGE_DOCKER_VOLUMES=true
docker volume create -d nfs nfsvol1
docker run -i -t  --rm -v nfsvol1:/data alpine ls /data

NB: It is not currently possible to run the plugin in both modes at the same time. This may change in a future version.

License

prologic/docker-volume-nfs is licensed under the terms of the MIT License based off of a fork of Ethan Lin's yzlin/docker-volume-nfs originally licensed under the Apache License.

Tag summary

Content type

Plugin

Digest

Size

6 MB

Last updated

over 4 years ago

docker plugin install prologic/docker-volume-nfs