Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared folder is not updated outside of container #51

Open
LeidenSpain opened this issue Oct 8, 2020 · 5 comments
Open

Shared folder is not updated outside of container #51

LeidenSpain opened this issue Oct 8, 2020 · 5 comments

Comments

@LeidenSpain
Copy link

I have been using the container perfectly (it works really well) but suddenly, I find that without having done anything, the content of the mounted unit is not updated (GDrive)

If I access the unit from other containers or from the system (Lubuntu 20.04) I don't see the new files added (by web browser).
But if I enter the rclone container and access the unit by console, if I see the new files.

I have looked to update the cache file in case it solved something, but I did not know how to do it

@ClemTheStudent
Copy link

Added these caps resolved the problem for me:
cap_add:
- SYS_ADMIN
- SETPCAP
- MKNOD
source: https://docs.docker.com/engine/reference/run/

@blastbeng
Copy link

blastbeng commented Jan 11, 2022

Hi, I think the issue it's still there, I'm using docker compose with an encrypted rclone mount:

version: '3.3'
services:
  rclone-mount:
    container_name: rclone-mount-${NAME}
    restart: unless-stopped
    cap_add:
      - SYS_ADMIN
      - SETPCAP
      - MKNOD
    security_opt:
      - apparmor:unconfined
    devices:
      - /dev/fuse
    environment:
      - 'RemotePath=$NAME:/'
      - 'MountPoint=/mnt/$NAME'
      - 'ConfigDir=/config'
      - 'ConfigName=$NAME.conf'
      - 'MountCommands=--allow-non-empty --allow-other'
    volumes:
      - '/my/custom/confdir/$NAME.conf:/config/$NAME.conf'
      - '/my/custom/mountpoint/$NAME:/mnt/$NAME:/'
    image: mumiehub/rclone-mount
    restart: unless-stopped

And in env file: NAME=mycustomname

If i access the container i can see the files under /mnt/$NAME but when i go to the host mount point i see nothing. Looks like docker can't correctly mount the mnt directory.... Any help?

@fede8802
Copy link

I had the same problem and solve it by seting the propagation as shared.

Try to do the following with the volumes declaration:

  - type: bind
    source: '/my/custom/mountpoint/$NAME'
    target: '/mnt/$NAME:/'
    bind:
      propagation: shared

@blastbeng
Copy link

blastbeng commented Jan 12, 2022

@fede8802 You're my savior!

I can confirm that this is the correct configuration using docker-compose:

version: '3.3'
services:
  rclone-mount:
    container_name: rclone-mount-${NAME}
    restart: unless-stopped
    cap_add:
      - SYS_ADMIN
      - SETPCAP
      - MKNOD
    security_opt:
      - apparmor:unconfined
    devices:
      - /dev/fuse
    environment:
      - 'RemotePath=$NAME:/'
      - 'MountPoint=/mnt/$NAME'
      - 'ConfigDir=/config'
      - 'ConfigName=$NAME.conf'
      - 'MountCommands=--allow-non-empty --allow-other'
    volumes:
      - '/my/custom/confdir/$NAME.conf:/config/$NAME.conf'
      - type: bind
        source: '/my/custom/mountpoint/$NAME'
        target: '/mnt/$NAME'
        bind:
          propagation: shared
    image: mumiehub/rclone-mount
    restart: unless-stopped

Now when using df i see the mount!

mycustomname:/ 20G 9,7G 11G 49% /mnt/mycustomname

@Mumie-hub
Copy link
Owner

Mumie-hub commented Jan 19, 2022

Here is an example rclone-mount/docker-compose.yml for ubuntu 18/20. Notice the version 2 of docker-compose! There are some MountCommands (https://rclone.org/commands/rclone_mount/) that manipulate the update interval e.g. --poll-interval --dir-cache-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants