stephenh / mirror

A tool for real-time, two-way sync for remote (e.g. desktop/laptop) development
Apache License 2.0
391 stars 37 forks source link

Mirroring directories on same server (Docker) #67

Closed EZarnosky closed 3 years ago

EZarnosky commented 3 years ago

I am trying to mirror a user folder to a shared folder on my docker host, but have been unsuccessful. Is this possible? If so what could be wrong with my compose file below?

Another question regarding increasing fs.inotify.max_user_watches & fs.inotify.max_queued_events, is this done in the docker container or the docker host?

version: "3.0"

services:
  mirror:
    image: quay.io/stephenh/mirror
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /opt/docker/folder:/data
      - /home/dockeruser:/data-local
    command:
      - --local-root /data
      - --remote-root /data-local
stephenh commented 3 years ago

Is this possible?

Maybe? I'm not sure. See next disclaimer.

If so what could be wrong with my compose file below?

You have two command lines but AFAIU a docker image can only have a single command that starts, so you're second one is probably being ignored.

In general mirror expects to run in a client/server setup, i.e. one machine is a server, and the other machine is the client and connects to it. So it's unclear in your docker setup ^ who is the server and who is the client.

So you probably need two separate services, like mirror-server and mirror-client and then configure them to talk to each other.

You can probably get it to work; let me know if you figure it out, but otherwise don't have time to help troubleshoot that specific setup.

fs.inotify.max_user_watches & fs.inotify.max_queued_events

I'm actually not sure. My guess is both host and container, but that's just a guess.