wetopi / docker-volume-rbd

Docker Engine managed plugin to manage RBD volumes.
MIT License
69 stars 18 forks source link

Unknown option 'mountOptions' #28

Open modrink opened 3 months ago

modrink commented 3 months ago

Hello!

It appears that mountOptions is not supported as a plugin option, despite the documentation stating:

# Available volume driver options:
fstype: optional, defaults to conf VOLUME_FSTYPE 'ext4'
mkfsOptions: optional, defaults to conf VOLUME_MKFS_OPTIONS value '-O mmp'
mountOptions: optional, defaults to conf MOUNT_OPTIONS value '--options=noatime'
size: optional, defaults to conf VOLUME_SIZE value 512 (512MB)
order: optional, defaults to conf VOLUME_ORDER value '22' (4KB Objects)

When running:

docker volume create -d wetopi/rbd -o size=206 -o mountOptions=--options=noatime,uid=1001,gid=1001 my_rbd_volume

I receive the error:

Error response from daemon: create my_rbd_volume: VolumeDriver.Create: unknown option 'mountOptions'

My use case involves images that use custom UID:GID permissions, such as Bitnami images which use the bitnami user with UID:GID of 1001:1001 (e.g., docker.io/bitnami/postgresql).

In the rbd-docker.go file, the supported options are size, order, fstype, mkfsOptions, and pool. This limitation forces me to set the global MOUNT_OPTIONS environment variable.

Is there an alternative solution to this?

Thanks!