This repository has been archived by the owner. It is now read-only.

host only networking as per boot2docker PR 198 #42

Merged
merged 2 commits into from Mar 5, 2014

Conversation

Projects
None yet
4 participants
@SvenDowideit
Contributor

SvenDowideit commented Feb 28, 2014

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit
Contributor

SvenDowideit commented Feb 28, 2014

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 28, 2014

Contributor

What about UPNP or MDNS? Seriously

Contributor

steeve commented Feb 28, 2014

What about UPNP or MDNS? Seriously

@riobard

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Feb 28, 2014

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 28, 2014

Contributor

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?).

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Feb 28, 2014

Contributor

@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.

Contributor

SvenDowideit commented Feb 28, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 1, 2014

Contributor

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?

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Mar 1, 2014

Contributor

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 :)

Contributor

SvenDowideit commented Mar 1, 2014

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

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 1, 2014

Contributor

@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.

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

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 3, 2014

Contributor

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?

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Mar 3, 2014

Contributor

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

Contributor

SvenDowideit commented Mar 3, 2014

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

@riobard

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 3, 2014

Contributor

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

Contributor

riobard commented Mar 3, 2014

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

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Mar 4, 2014

Contributor

@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.

Contributor

SvenDowideit commented Mar 4, 2014

@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 riobard added the enhancement label Mar 4, 2014

@riobard

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 4, 2014

Contributor

SGTM!

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

This comment has been minimized.

@tianon

tianon Mar 4, 2014

Contributor

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

@tianon

tianon Mar 4, 2014

Contributor

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

This comment has been minimized.

@riobard

riobard Mar 4, 2014

Contributor

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.

@riobard

riobard Mar 4, 2014

Contributor

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.

This comment has been minimized.

@tianon

tianon Mar 4, 2014

Contributor

+1

@tianon

tianon Mar 4, 2014

Contributor

+1

This comment has been minimized.

@riobard

riobard Mar 4, 2014

Contributor

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

@riobard

riobard Mar 4, 2014

Contributor

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

This comment has been minimized.

@SvenDowideit

SvenDowideit Mar 5, 2014

Contributor

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

@SvenDowideit

SvenDowideit Mar 5, 2014

Contributor

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

@@ -26,6 +26,12 @@ var B2D struct {
Memory int // VM memory size (MB)
SSHPort int // host SSH port (forward to port 22 in VM)
DockerPort int // host Docker port (forward to port 4243 in VM)
HostIP string // Host only network IP address

This comment has been minimized.

@tianon

tianon Mar 4, 2014

Contributor

You should add an empty line above this block of "Host only network" stuff so that gofmt doesn't have to reindent the entire struct just for these. :)

@tianon

tianon Mar 4, 2014

Contributor

You should add an empty line above this block of "Host only network" stuff so that gofmt doesn't have to reindent the entire struct just for these. :)

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Mar 4, 2014

Contributor

LGTM :)

Contributor

steeve commented Mar 4, 2014

LGTM :)

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Mar 5, 2014

Contributor

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

Contributor

SvenDowideit commented Mar 5, 2014

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

@riobard

This comment has been minimized.

Show comment
Hide comment
@riobard

riobard Mar 5, 2014

Contributor

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

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

Merge pull request #42 from SvenDowideit/host-only-network
host only networking as per boot2docker PR 198

@SvenDowideit SvenDowideit merged commit e12c010 into boot2docker:master Mar 5, 2014

@SvenDowideit SvenDowideit deleted the SvenDowideit:host-only-network branch Mar 24, 2014

SvenDowideit pushed a commit to SvenDowideit/boot2docker-cli that referenced this pull request Nov 10, 2014

Merge pull request #42 from brandonparsons/patch-1
Updated README for Disk Persistence on Virtualbox.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.