Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

File sharing via rsync #66

Closed
Closed

Activity

  1. schickling commented on Apr 5, 2014

    @schickling

    This seems like a perfect workaround for the folder sharing. Any intentions on implementing this?

  2. riobard commented on Apr 6, 2014

    @riobard
    ContributorAuthor

    Personally I don't have any use for this, so I guess not :|

  3. schickling commented on Apr 6, 2014

    @schickling

    So what are the further plans concerning folder sharing?

  4. riobard commented on Apr 6, 2014

    @riobard
    ContributorAuthor

    I'm not sure. @SvenDowideit do you have any idea?

  5. SvenDowideit commented on Apr 7, 2014

    @SvenDowideit
    Contributor

    I currently use samba to share a data volume - see https://github.com/SvenDowideit/dockerfiles/blob/master/samba/Makefile

    I'm still poking it to see what improvements I can make - and magic syncing will be interesting

  6. schickling commented on May 30, 2014

    @schickling

    Are you still using Samba @SvenDowideit ?

  7. SvenDowideit commented on May 30, 2014

    @SvenDowideit
    Contributor

    very much so. Though I'm also looking forward to seeing the docker client based work by @bradfitz

  8. schickling commented on May 30, 2014

    @schickling

    @SvenDowideit could you provide your current workaround in a document/wiki page?

  9. added a commit that references this issue on Nov 10, 2014
  10. blaggacao commented on Jul 12, 2015

    @blaggacao

    Have a look at: https://github.com/brikis98/docker-osx-dev
    It seems like a complete take, but unfortunately only on OS X.

  11. blaggacao commented on Jul 13, 2015

    @blaggacao

    Digging through, I noticed that it doesn't work for windows, as they make use of the fswatch library. So I found https://github.com/thekid/inotify-win/ it's kind of a gluecode, mapping the FileSystemWatch api to an inotify command. I think a competent person, would be able to stick the peaces together. It might be worthwhile to monitor, what Enrico's opinion might be on emcrisostomo/fswatch#88

  12. emcrisostomo commented on Jul 13, 2015

    @emcrisostomo

    Hi @blaggacao, as I told you on emcrisostomo/fswatch#88 it wouldn't be difficult writing a fswatch monitor for Windows. At the moment, thought, I'm not doing it because I lack time and other issues in the pipeline for fswatch.

    I had a (very) quick glance to inotify-win but it doesn't look like the glue code you are thinking. Instead, it's a C# port of inotifywait tool.

  13. blaggacao commented on Jul 13, 2015

    @blaggacao

    @SvenDowideit : maybe a good starting point would be to preinstall rsync in the docker image, so that people who are akin to the topic but do not know the build details of the tc linux can start to find solutions.

    Meanwhile, just log into boot2docker as normal docker user and copyenter: tce-load -wi rsync

  14. blaggacao commented on Jul 13, 2015

    @blaggacao

    A basic shell script implementation for windows, based on

    #!/bin/bash
    SSH_CALL="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i $(boot2docker config | awk '/SSHKey/ {print $3;}' - | sed -r 's/\"//g')"
    TARGET=$2
    $SSH_CALL docker@$(boot2docker ip) "sudo mkdir -p $2 && sudo chown docker $2 && tce-load -wi rsync"
    rsync -aqrz --exclude '.git/*' -e "$SSH_CALL" $(readlink -f $1)/* "docker@$(boot2docker ip):$TARGET" 
    
    while FOLDER=$(cygpath --unix $(inotifywait -r -q -R --format %w $1)); do
        REL_TARGET=$(echo "$FOLDER" | sed -r "s|$(readlink -f $1)|$2|g")
        # some previous command throws #015 chain miraculously, so we get rid of it.
        SOURCE=$(echo "$FOLDER" | sed -r "s|#015||g")
        # Sync the file's containing folder (only: for speed) to it-s remote counterpart.
        rsync -avrz --exclude '.git/*' -e "$SSH_CALL" $SOURCE/* "docker@$(boot2docker ip):$REL_TARGET"
    
    done
    

    use, put in /usr/bin as b2dsync

    b2dsync . /mnt/dir
    to sync the current directory with /mnt/dir on the host. Do not do /mnt/dir/ - my regex skills do not suffice for that.

    A re-implementation in go in the boot2docker cli should be however quite easy.

    Bi-directional is not needed for the standard "developing on host, running on docker" case. But without this functionality it's really a pain.

    However we would need better backend support as to the file system watch apis on the different systems.

  15. blaggacao commented on Jul 13, 2015

    @blaggacao

    The above comment has been updated with a complete bash script. This works under windows with cygwin. But the main concepts should work within the b2d cli as well...

    It has to be discussed what should be the scope of an rsync triggered by a single file. If only the containing folder is synced, it support's most of the developing use cases, but remains speedy... (did I get that stright?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions