wetopi / docker-volume-rbd

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

Info: How to make this plugin work with non-root containers #25

Closed Flexusma closed 8 months ago

Flexusma commented 8 months ago

I just researched how to get this plugin to work with non-root containers for 6 hours and have come up with a possible solution.

It is required that you know the uid (for example 1001):

By specifying mkfsOptions: "-Eroot_owner=<uid>:<(g)uid>" the created FS will not be assigned to root but to the targeted user.

I hope this helps any other souls trying to figure this out as well :)

Heres a compose volume config example:

volumes:
  myimage:
    driver: "wetopi/rbd"
    driver_opts:
      size: 3000
      mkfsOptions: "-Eroot_owner=1001:1001"
      #      o: "size=512"