Added an hostonly interface with fixed ip address for guest and host#93
Added an hostonly interface with fixed ip address for guest and host#93moul wants to merge 7 commits intoboot2docker:masterfrom
Conversation
|
👍 This is definitely the way to go in my opinion - much simpler than doing port-forwarding. I'm going to have a go at porting the /etc/hosts thing over from docker-osx. |
|
OK, have a look at https://github.com/aanand/boot2docker/compare/hostonly I also rebased onto the current master, but there was a conflict in the first commit and I don't fully understand it, so you might want to have a quick look at d5d7db7 to see if anything broke. |
|
OK, I think I fixed the rebase. Sorry for the noise. |
|
Thanks ! 👍 |
|
@steeve, @bfirsh, @aanand what do you think about this ? The main difficulty is about having a dedicated VirtualBox interface, since the user can use boot2docker alongside other typical virtual machines A big part of the commits is dedicated to handling this and also the reboot issue |
|
To paint a bikeshed, I wonder if |
|
My thoughts are.
I guess the main points of ease of use is getting an entry into their hosts file and into their @aheissenberger in the osacript thing, I get where you're coming from, but when I tried it, it pops up a pretty weird dialog asking for your password, which for me at least was a little bit unexpected coming from a command line install. I expect to enter my password for sudo, but the popup almost looked a little virusey. When you mount an nfs share with vagrant, it asks you for your sudo password. Perhaps we can make the assumption that as a developer they'll have admin rights, or try to detect this first? |
|
@eugeneware I always use a user on OSX without admin rights (= no sudo) and my boot2docker script tests if the user has access to sudo and will only use the oascript on OSX if there is no other way to get access to sudo. a developer with admin rights (= access to sudo) will not see any kind of popup: The way I implemented the host only interface you will allway get a unique IP and I will reuse any existing vbox interface as long it complies to my requirements. to enjure that that I know the IP I will add an magic update of the IP to the local /etc/hosts file. |
|
@aheissenberger strange, because when I used the nfs mapping script I definitely got a popup, and I have Admin rights. Maybe that script doesn't check? Not a big deal in any way, just some feedback. |
|
@eugeneware can you do a |
|
@eugeneware fixed it - have not tested it with an admin user - should work now without the popup for you |
|
Thanks @aheissenberger! You rock! |
|
finished my hostonly interface implemetation which also includes now setting /etc/hosts and ~/.bash_profile |
Setup HOME directory mounting using this [workaround](boot2docker/boot2docker#284). Uses an forked boot2docker shell script (based on boot2docker/boot2docker#93) but fast forward to the latest master to allow a fixed ip address for guest and host (aka localdocker). Removed Vagrant, VM is managed by VirtualBox alone.
|
Any news regarding this? :) |
|
the replacement project (https://github.com/boot2docker/boot2docker-cli has a second hostonly network interface added - and work is ongoing to add more control. so yes, but over there :) |
|
Closing, as this is working in boot2docker-cli. |
|
For those curious about how it works in boot2docker-cli (which I installed with Boot2Docker.app) you need to expose the port as normal (using |
|
boot2docker-cli that been a solution to this now deprecated... I think issue is active again |
|
The solution today would be to do it via |
With this secondary interface we can now publish ports (
docker run ... -p 8000:80for instance) without needs to configure new nat rulesThe
dockerip is172.18.42.1, thehostip is172.18.42.254Since it's a secondary interface, it don't brake anything, you can still use
127.0.0.1:2022and127.0.0.1:4243TODO:
DOCKER_HOSTin .bashrc ?cc #85 (Give the VM a hostname in the init script)
cc #87 (NFS Client & Server, create a second host only network interface)
cc #84 (Automatically mount home directory in init script)
cc #73 (boot2docker / Forward all dynamic assigned ports)
cc #64 (nfs share / guest to host)
cc #104 (boot2docker / docker auto mapping port forwarding)
cc #62 (nfs volume)