docker-bg-sync
docker-bg-sync copied to clipboard
Can Multiple Containers Share One bg-sync service/mount point?
I assumed it could, but it only syncs to the first service specified in the volumes_from
list. Plus: my containers won't share the same mount: with docker inspect
shows that each one has a distinct mount point. Is it an intrinsic limitation or am I missing something in the configs?
services:
web:
working_dir: /app-sync
volumes:
- /app-sync
spring:
working_dir: /app-sync
volumes:
- /app-sync
sidekiq:
working_dir: /app-sync
volumes:
- /app-sync
bg-sync:
image: cweagans/bg-sync
volumes:
- .:/source
volumes_from:
- spring
- web
- sidekiq
environment:
- SYNC_DESTINATION=/app-sync
- SYNC_MAX_INOTIFY_WATCHES=40000
- SYNC_VERBOSE=1
privileged: true
I've never used it in this particular configuration, so I'm not sure if this will work or not. Generally speaking, it just syncs from one dir to another, so if there's some way of having a docker container with a volume at /foo, and have 1+ other containers all mount the volume from the first container, then there should be some way of getting this container to do what you want to do.
(also, I haven't been spending much time on this lately -- https://mutagen.io/ has been a much nicer solution that isn't so touchy)