maltokyo / docker-google-drive-ocamlfuse

Docker version of google-drive-ocamlfuse
MIT License
17 stars 8 forks source link

Docker google-drive-ocamlfuse

Docker image to mount a google drive with google-drive-ocamlfuse shared with the host (Fully Tested on Debian Buster Host, but should work on any Linux system).

Main Repository page (maintained by @astrada):

(all issues that are not specifically docker related should be posted there)

https://github.com/astrada/google-drive-ocamlfuse

Docker Hub page:

https://hub.docker.com/r/maltokyo/docker-google-drive-ocamlfuse

Environment Variables

Host Configuration (one-time effort)

  1. If using systemd to manage the docker daemon process make sure that the service is configured either explicitly with a shared mountflag or un-configured and defaults to shared.
  2. The mount point will also need to have it's propagation explicitly marked as shared.

Without this the fuse mount will not propagate back to the host.

# Ensure docker daemon uses shared mount flags (this was not needed on Debian Buster, check your distro accordingly)
sed -i 's/MountFlags=\(private\|slave\)/MountFlags=shared/' /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker.service

# Specify the mount points propagation as shared (execute as root), change the path according to your preference, this is just an example
mount --bind /mnt/drive /mnt/drive
mount --make-shared /mnt/drive

Usage with Docker or docker-compose

Docker Run:

docker run -d \
-e CLIENT_ID='my-client-id' \
-e CLIENT_SECRET='my-client-secret' \
-e VERIFICATION_CODE='my-verification-code' \
--security-opt apparmor:unconfined \
--cap-add mknod \
--cap-add sys_admin \
--device=/dev/fuse \
-v /mnt/drive:/mnt/gdrive:shared \
maltokyo/docker-google-drive-ocamlfuse:0.7.19

Docker Compose (recommended):

Use the docker-compose file included at https://github.com/maltokyo/docker-google-drive-ocamlfuse

Structure