luxifer/dokku-redis-plugin — pull request #10 by nfelger (2013-12-04 20:27:17+00:00)
Title: Fix for issue #9: Moving persistent volumes to $DOKKU_ROOT.

I had the same issue as described in https://github.com/luxifer/dokku-redis-plugin/issues/9.
(Disclaimer: I'm a total docker/dokku newb, so apologies if this goes in completely the wrong direction.)

Looking at the source and the error message, the issue seems to be that the user running dokku doesn't necessarily have permission to write to /var/lib/docker/volumes and therefore cannot rename the docker volume after it's been created. The solution seems to be putting the persistent volumes somewhere under $DOKKU_ROOT, where the user running dokku is guaranteed to have write permissions. This allows for removing the rename step and incidentally also seems to be what some other plugins are doing: see https://github.com/jeffutter/dokku-mongodb-plugin/blob/master/commands#L7 and https://github.com/Kloadut/dokku-pg-plugin/blob/master/commands#L40.

I wasn't quite sure how to test this, so this patch is very much in a "works-on-my-machine" state! :)