1

Ok, I have an interesting one I could use everyones help on.

I am using "rclone mount" to mount a remote directory to my host (Ubuntu Server). I then want to use Docker Compose to set the remote mounted directory into a Docker container volume. I have tried separate ways and all of them result in some form of a permissions error.

* Paths have been simplified for ease of following.

The rclone mount is at ~/parent/remote.

If I try to set ~/parent as the volume, I get the below error.

volumes:  
    - ./parent:/parent

# This results in the remote folder having all "?" as its permissions inside the container.

drwxr-xr-x 4 abc abc 4096 Apr 25 08:38 ..
d????????? ? ?   ?      ?            ? remote

If I try to set ~/parent/remote as the volume, I get the below error on docker compose up.

volumes:  
    - ./parent/remote:/remote

Error response from daemon: error while creating mount source path '~/parent/remote': mkdir ~/parent/remote: file exists

Lastly, I have tried using a bind mount with propagation settings and I get the below error:

volumes: 
  - type: bind
    source: ./parent/remote
    target: /remote
    bind:
      propagation: shared

Error response from daemon: error while creating mount source path '~/parent/remote': mkdir ~/parent/remote: file exists

How can I mount the rclone mount directory as a volume into a Docker container?

1 Answer 1

0

So I learned the issue was actually on the rclone mount side. Adding --allow-other to the mount command allows the Fuse Mount to be accessible by others, not just the user running the daemon command.

This allowed Docker to pass the credentials down to the container.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .