-1

I'm trying to limit the size of a volume that will use nfs (--opt type=nfs).

I tried creating a volume and mounting it like this:

docker volume --driver local --opt type=nfs --opt o=addr=<IP>,rw --opt o=size=1g --opt device=:/nfs_share/my_volume my_volume

docker create --volume my_volume:/directory/inside/container:rw my_image

But when starting the container I get error:

"Error response from daemon: error while mounting volume '/var/lib/docker/volumes/my_volume/_data': failed to mount local volume: mount :/nfs_share/my_volume:/var/lib/docker/volumes/my_volume/_data, data: size=1g: invalid argument\nError: failed to start containers: 35f52c624d3c462b9b8934467c4e82595bbdbb2e0cfd8988d43d366d905c9ade

Enx
  • 65
  • 1
  • 5

1 Answers1

0

I was able to limit the directory sizes with xfs_quota because my file system is xfs. Followed this page https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/xfsquota

Enx
  • 65
  • 1
  • 5