I’m working on a log gathering/analysis solution that uses sshfs to mount remote drive for acquiring the updates of the logs in realtime. Now I want to create a Docker user to process the log that makes use of this remote drive from the sshfs Docker.

I’ve tried with volumes-from, with which only the file system device were mounted but not the mount table so I can’t see the content of sshfs from the processor’s container. Here’s what I did:

$ docker run --volumes /sshfs --rm -it --name "my_sshfs_1" --privileged my_sshfs
# mkdir /sshfs/logs  # in the container
# sshfs user@ip:remote_dir /sshfs/logs &
# ls /sshfs/logs
log1 log2 log3

In another terminal:

$ docker run --volumes-from my_sshfs_1 --rm -it ubuntu
# ls /sshfs     # in the container
# ls /sshfs/logs

I expect the last ls /sshfs/logs would show up the same files as the my_sshfs_1 container does but it doesn't. Is there a way I can achieve this? Thanks.


I finished up solving this problem by establishing an additional sshfs between the two dockers. I am still looking for better solutions :)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.