-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeBSD support using rsync mechanism #458
Conversation
thats very interesting, thank you for putting work into that! i have to review that for a bit, but i am sure to be interested to merge it. |
@EugenMayer, thanks, let me know if any change is required. |
@omab would be great if you could fix / comment on the above |
@EugenMayer I don't see any comment |
lib/docker-sync/dependencies.rb
Outdated
Docker.ensure! | ||
Unison.ensure! if config.unison_required? | ||
Rsync.ensure! if config.rsync_required? | ||
Fswatch.ensure! if config.fswatch_required? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fswatch should be OSX related, has nothing to do here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -97,7 +97,7 @@ def start_container | |||
user_mapping = get_user_mapping | |||
group_mapping = get_group_mapping | |||
|
|||
cmd = "docker run -p '#{@options['sync_host_port']}:873' -v #{volume_name}:#{@options['dest']} #{user_mapping} #{group_mapping} -e VOLUME=#{@options['dest']} -e TZ=${TZ-`readlink /etc/localtime | sed -e 's,/usr/share/zoneinfo/,,'`} --name #{container_name} -d #{@docker_image}" | |||
cmd = "docker run -p '#{@options['sync_host_port']}:873' -v #{volume_name}:#{@options['dest']} #{user_mapping} #{group_mapping} -e VOLUME=#{@options['dest']} -e TZ=${TZ-`readlink /etc/localtime | sed -e 's,/usr/share/zoneinfo/,,'`} -e ALLOW=#{@options['sync_host_allow']} --name #{container_name} -d #{@docker_image}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that looks a bit unplanned, you changed somehting here which has not been part of the intention of the PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ALLOW
rule is to let it override the value here entrypoint.sh#L86, I came across this need because Virtualbox
will use IPs in the 10.0.0.0/8
net when using the host-only network interface.
Some options to improve it:
- Revert the change in this file and propose a PR against https://github.com/EugenMayer/docker-image-rsyncd to improve the IP range to support the
10.0.0.0/8
private network - Keep the override but let it be included only if the option was defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well i see what you mean, but then add the docs for this option sync_host_allow
here https://github.com/EugenMayer/docker-sync/blob/master/example/docker-sync.yml
and here https://github.com/EugenMayer/docker-sync/wiki/2.-Configuration
so people know about it, be sure to add a comment what this is for.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need default value for it? What if it's missing from the config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot "guess" what private network there might be - so there cannot be a default value, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but, without any default, -e ALLOW=#{@options['sync_host_allow']}
will turn into -e ALLOW=
which I assume is not a valid syntax?
if we can't have default, then the argument should be added only when @options['sync_host_allow']
is not blank?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure that will be needed, right - so if blanc, skip the whole argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If value is blank, then bash will default to 192.168.0.0/16 172.16.0.0/12
since the rule is constructed like: ALLOW=${ALLOW:-192.168.0.0/16 172.16.0.0/12}
, still I do agree that's cleaner to just avoid the parameter if unset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EugenMayer, @ignatiusreza, changes done
sorry, forgot to commit the review, my bad |
that looks very solid now, wonderfull. Now lets finish the docs. I added freebsd in the TOC: https://github.com/EugenMayer/docker-sync/wiki and added a page here: When we have all this stuff in place, i am very happy to add freeBSD here, very nice! |
@EugenMayer, I've updated the wiki page as requested. Thanks! |
great, thank you for your work. I added a note about native_osx - i understand its way to obvious for you not to mention it but i learned .. there is no such thing :) Thank you for the patience and your effort in the docs, not only code wise! |
Thanks! |
This PR brings support for
FreeBSD
platform usingrsync
mechanism (unison
should also be possible but I haven't tried it yet).Docker support on FreeBSD is possible through
docker-machine
usingvirtualbox
running aboot2docker
virtualmachine which is then connected to the host by thegeneric
driver.Overall changes:
FreeBSD
environmentrsyncd
allowed hosts bysync_host_allow
docker-sync.yml
value