Reputation: 11
I'm trying to mount a Google Drive folder as a volume in my Docker container using rclone mount. I've successfully mounted the drive on my Ubuntu 22.04 Docker host at /mnt/gdrive using the following command:
rclone mount gdrive:my-folder /mnt/gdrive --allow-other --vfs-cache-mode writes
My docker run command is:
docker run -d -v /mnt/gdrive:/app/data --name my-app my-image
However, when my application inside the container attempts to write to /app/data
, I get "Permission denied" errors.
I've tried addressing this by using the --user flag
in docker run:
docker run -d -v /mnt/gdrive:/app/data --user 1000:1000 --name my-app my-image
I determined the UID and GID (1000:1000) by running id myuser (where myuser is the user that runs rclone mount) on the host.
Despite this, the permission issues persist. I've also tried:
chmod 777 /mnt/gdrive
(as a test, which worked, but is obviously not a solution)./mnt/gdrive
.Here's the relevant output of ls -l /mnt/gdrive
:
drwxr-xr-x 1 myuser myuser 0 Jan 1 00:00 .
Here's the output of docker version:
Client: Docker Engine - Community
Server: Docker Engine - Community Engine:
containerd:
runc:
docker-init:
rclone version:
rclone v1.63.1
I acknowledge the content of this question but it wasn't helpful: How to fix Docker: Got permission denied issue
Note: some specific data and path names are omitted or modified in order to protect privacy of sensitive informations.
I suspect there's something I'm missing regarding user mappings between the host and container, especially with rclone. How can I correctly configure permissions so my container can write to the Google Drive mount?
Upvotes: 1
Views: 57