What is the problem you are having with rclone?
When upgrading from 1.56.2 to 1.57.0 docker image that mounts a remote to be shared with other containers errors with
2021/11/08 13:10:09 Fatal error: Directory already mounted, use --allow-non-empty to mount anyway: /mnt
Presumably related to pull #5593
What is your rclone version (output from rclone version
)
rclone/rclone:1.56.2 -> rclone/rclone:1.57.0
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Linux 64bit running docker (Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.1)
Which cloud storage system are you using? (eg Google Drive)
Google drive (although this wouldn't be specific to particular backend)
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
docker-compose.yaml
version: "3.8"
services:
rclone-gsuite:
#image: rclone/rclone:1.56.2
image: rclone/rclone:1.57.0
container_name: rclone-gsuite-tmp
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse
security_opt:
- "apparmor:unconfined"
environment:
- RCLONE_ALLOW_OTHER=true
- RCLONE_VERBOSE=2
volumes:
- ~/.config/rclone:/config/rclone
- type: bind
source: ${PWD}/mnt
target: /mnt
bind:
propagation: shared
command: ["mount","Encrypt_gsuite:","/mnt"]
Command
docker-compose up
The rclone config contents with secrets removed.
[gsuite]
type = drive
client_id = ***secret***.apps.googleusercontent.com
client_secret = ***secret***
scope = drive
token = {"access_token":"***secret***","token_type":"Bearer","refresh_token":"***secret***","expiry":"2021-11-08T14:14:02.909276049Z"}
root_folder_id = ***secret***
[Encrypt_gsuite]
type = crypt
remote = gsuite:jottacloud
filename_encryption = standard
directory_name_encryption = true
password = ***secret***
A log from the command with the -vv
flag
Attaching to rclone-gsuite-tmp
rclone-gsuite-tmp | 2021/11/08 13:20:31 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "mount" "Encrypt_gsuite:" "/mnt"]
rclone-gsuite-tmp | 2021/11/08 13:20:31 DEBUG : Creating backend with remote "Encrypt_gsuite:"
rclone-gsuite-tmp | 2021/11/08 13:20:31 DEBUG : Using config file from "/config/rclone/rclone.conf"
rclone-gsuite-tmp | 2021/11/08 13:20:31 DEBUG : Creating backend with remote "gsuite:jottacloud"
rclone-gsuite-tmp | 2021/11/08 13:20:31 Fatal error: Directory already mounted, use --allow-non-empty to mount anyway: /mnt
I think this is related to how host bind mounts are presented to the container.
For example
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/test--vg 62G 17G 43G 29% /
# docker run -it --rm --mount type=bind,source=${PWD}/mnt,target=/mnt,bind-propagation=shared ubuntu
root@cfe8a41ddd17:/# grep "/mnt" /proc/mounts
/dev/mapper/test--vg /mnt ext4 rw,relatime,errors=remount-ro 0 0