I want to make some software use google cloud as storage. These software come packaged as docker images, where you can attach a volume to it, and it will store the data there.
I created a remote in rclone called GDrive and mounted it to /home/me/GDrive.
But if I simply try to pass some directory inside it as volume, I get an error as follows
docker run -i -v ~/GDrive/SoftwareData/archivebox:/data -p 8000:8000 archivebox/archivebox
docker: Error response from daemon: error while creating mount source path '/home/me/GDrive/SoftwareData/archivebox': mkdir /home/me/GDrive: file exists.
So apparently this won't work.
Another option I considered is to create a docker volume using the docker volume plugin for rclone. But I am not able to understand the command properly.
Does create a volume, but it doesn't have any of the files from the remote. So most likely it's doing something entirely different. I am unable to figure out what the remote option is expected to take. It seems to me from the example at Docker Volume Plugin that it's the name of the remote from the config file.
@albertony
Using local remotes (without a colon) in connection with docker plugin is so useless (who would want to mount a directory from plugin container?) that I'm thinking of making colon a requirement and return error otherwise.
Docker plugin needs a config file in a special location, independent from your user's rclone config.
Your GDrive does not have a /home/me/GDrive/SoftwareData directory you requesting
You didn't read the manual where it's all explained
.....
Ahh, one more.....
You wanted to use a remote in containers. Docker gives you docker run -v ... on command line and volumes in compose right for that.
Now you mount it on host. Why?
Sounds like a good idea!
I've noticed there are quite a few "support" cases due to missing colons in general... Not sure how to avoid it, but at least for the container use case it makes sense to treat it as an error.
docker volume with rclone will only allow root:root to write, right? So anything inside the container that wants to write files must do so as root user. If I understand correctly, this is because google drive doesn't understand file permission the same way as unix does.