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

host only networking as per boot2docker PR 198 #42

Merged
merged 2 commits into from
Mar 5, 2014

Conversation

SvenDowideit
Copy link
Contributor

It works, creates a new network when needed, or reuses one if the cfg is the same as the one specified.

We need something to get the IP address out of the VM.

  • using a scripted ssh isn't very portable - expect on windows?
  • perhaps just add a fingerd to boot2docker that just spits out some status?
  • or ... is this information available via the docker API?

@SvenDowideit
Copy link
Contributor Author

@steeve @tianon @riobard @aheissenberger what do you think?

@steeve
Copy link
Contributor

steeve commented Feb 28, 2014

What about UPNP or MDNS? Seriously

@riobard
Copy link
Contributor

riobard commented Feb 28, 2014

Do you want the actual IP of the VM before it's running? I thought it's dynamically assigned, so you have to wait until the VM is booted.

@steeve
Copy link
Contributor

steeve commented Feb 28, 2014

I'm really thinking mDNS (Zeroconf/Bonjour) is the way to go.

Because:

  • its use case is specifically this: machine discovery
  • nss-mdns is already in the TCL repo (we can choose to start it only if on VMs)
  • there are pure-go mDNS implementation (both provider and consumer)

Also, for shared folders, we will need guest->host mounting: that means the VM will need the host IP too (maybe we already have it if the host is the DHCP?).

@SvenDowideit
Copy link
Contributor Author

@steeve thankyou - last month I was thinking mDNS, this month its totally slipped my mind.

I'm still hoping that we can implement shared folders the other way round - using data-containers that are shared using nfs/samba/whatever - and this PR lays the groundwork (ie, automates what I did by hand :) ) Then again, BEAM might just totally do away with the need for the host dir portion.

@riobard
Copy link
Contributor

riobard commented Mar 1, 2014

Oops, seems you are talking about a different use case :)

@SvenDowideit People on OS X/Windows would still need a way to share files from the host OS to the VM. How does the data container approach solves that problem? I was trying to build a dev box using containers before but the file sharing is problematic on OS X which made that plan unattractive :(

I don't know what is BEAM, do you mean this repo https://github.com/dotcloud/beam?

@SvenDowideit
Copy link
Contributor Author

riobard, no not really, What I'm proposing, is that rather than have boot2docker mount your User dir - and steal all your data and send it to someone so they can hack your bank account, that you mount a data volume on your OSX box, and then work from there.

There are a couple of benefits - the files are local to the docker daemon, so that can be faster - meaning you can share a docker vm with other people, and not have network issues, security - which is kind of important, and it means we leverage some core docker best practices right from the get-go.

So the work flow is - create a data-container, attach an nfs/smb/?? server container to that data-volume, and then mount it from the OSX/Windows box.

if you can show me a use case where inverting the solution can't work, please keep throwing them at me until we come to a working solution :)

@riobard
Copy link
Contributor

riobard commented Mar 1, 2014

@SvenDowideit Thanks for the clarification! Now I see how it's supposed to work. Yes, I agree this is a more secure solution.

I think SMB2 would be ideal, as it is supported natively on both OS X (10.9+) and Windows (7+ I think?), and it is supposed to have good performance (compared to SMB) especially with lots of small files.

@riobard
Copy link
Contributor

riobard commented Mar 3, 2014

I was watching @bradfitz talking about Camlistore at FOSDEM '14 today. From there I found a pure Go implementation of a FUSE filesystem (http://bazil.org), so another option is maybe Docker can expose a filesystem that OS X users can mount using OS X FUSE?

@SvenDowideit
Copy link
Contributor Author

mmm, bazil's not got windows support yet :/

@riobard
Copy link
Contributor

riobard commented Mar 3, 2014

Yeah, that's right. Windows doesn't support FUSE either…

@SvenDowideit
Copy link
Contributor Author

@steeve @riobard @tianon @aheissenberger

can we merge this, then I'll work on adding mDNS (client side) to detect the hostonly ip address, (and maybe even DOCKER_HOST and SSH settings?) that the boot2docker OS (or the docker daemon itself) broadcasts.

@riobard
Copy link
Contributor

riobard commented Mar 4, 2014

SGTM!

- `BOOT2DOCKER_NetworkMask` - host only network's network mask
- `BOOT2DOCKER_LowerIPAddress` - host only network's DHCP Server IP range
- `BOOT2DOCKER_UpperIPAddress` - host only network's DHCP Server IP range
- `BOOT2DOCKER_DHCPEnabled` - host only network's DHCP Server enabled flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure these are the correct env vars the code is actually checking for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README is really outdated now :)

Should we get rid of env vars all together and rely on flags + profile for config (i.e. the Docker approach)? Somehow I feel env vars won't scale as we add more options down the road.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll rewrite the config code tomorrow. I'll create a PR once it's in good shape.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent. I really detest ENV vars - they cause all sorts of pain supporting users that forgot, or didn't realise that there was one sitting in their .profile

@steeve
Copy link
Contributor

steeve commented Mar 4, 2014

LGTM :)

@SvenDowideit
Copy link
Contributor Author

@riobard can we merge this before you change the config code to use flags?

@riobard
Copy link
Contributor

riobard commented Mar 5, 2014

@SvenDowideit Sure! I'll fix the config and README then.

SvenDowideit added a commit that referenced this pull request Mar 5, 2014
host only networking as per boot2docker PR 198
@SvenDowideit SvenDowideit merged commit e12c010 into boot2docker:master Mar 5, 2014
@SvenDowideit SvenDowideit deleted the host-only-network branch March 24, 2014 04:31
SvenDowideit pushed a commit to SvenDowideit/boot2docker-cli that referenced this pull request Nov 10, 2014
Updated README for Disk Persistence on Virtualbox.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants