Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

FR: Get internal IP of cloud hosted machine #1342

Open
kacole2 opened this issue Jun 9, 2015 · 12 comments
Open

FR: Get internal IP of cloud hosted machine #1342

kacole2 opened this issue Jun 9, 2015 · 12 comments

Comments

@kacole2
Copy link
Contributor

kacole2 commented Jun 9, 2015

It would be great if I could get the internal/private IP address of my machine for doing some cluster management work. currently docker-machine ip mymachine will give me the external IP address.

it would be awesome if it were possible to have something like docker-machine private-ip mymachine. This way I can build configurations using the docker-machine CLI.

i noticed in the diagnostics it's grabbing this so perhaps it wouldn't be hard to add. I need to work on my go skills so I can contribute

waiting for ip address to become available
Got the IP Address, it's "54.152.119.19"
created instance ID i-3ef47497, IP address 54.152.119.19, Private IP address 172.31.32.81
@ghost
Copy link

ghost commented Jun 9, 2015

I have heard that Machine will eventually support cloud-init which will include $public_ipv4 and $private_ipv4 variables.

@sthulb
Copy link
Contributor

sthulb commented Jun 10, 2015

It will. For a command though, perhaps machine ip --internal would be cool.

@nathanleclaire
Copy link
Contributor

docker-machine ip --private seems reasonable, although it should come with a caveat that it's only available where such a private IP is supported.

@aperepel
Copy link

@nathanleclaire adding a private ip command isn't too difficult, but it would require an update to a driver spec, wouldn't it? Wanted to check your stance on this, as it will cut across every driver implementation as a result.

@ehazlett
Copy link
Contributor

@aperepel IMO it probably should. Something like GetPrivateIP that way drivers that don't support it can return an err.

@nathanleclaire
Copy link
Contributor

Yes, we would have to update the drivers to have such a method.

@aperepel
Copy link

I could take a look, but before I do, any tips on picking up an internal IP? E.g. I had cases when 5 different ones were returned.

aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…actual implementation for GCE, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…actual implementation for GCE, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…actual implementation for GCE, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…actual implementation for GCE, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…actual implementation for GCE, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
@aperepel
Copy link

Hey guys, I took the first cut and implemented the GCE driver support (ways to get at private ip will differ greatly for each provider). All other drivers are simply throwing an error for the GetPrivateIP() #1355

aperepel added a commit to aperepel/machine that referenced this issue Jun 12, 2015
…Implemented support for VirtualBox (and some refactoring)

Signed-off-by: Andrew Grande <[email protected]>
@aperepel
Copy link

Figured out the VirtualBox part too, added to the same PR.

aperepel added a commit to aperepel/machine that referenced this issue Jun 15, 2015
…implementation for GCE and VirtualBox, placeholders for the rest currently)

Signed-off-by: Andrew Grande <[email protected]>
@schickling
Copy link

Thanks for your PR @aperepel. I hope this will get some docker love eventually!

@andrestc
Copy link
Contributor

andrestc commented Sep 6, 2016

Hi! This would be an awesome feature for my use case. Are you still working on this @aperepel?
@nathanleclaire, are we still looking at implementing this and updating the driver spec?

I can PR this.

@andrestc
Copy link
Contributor

Hi guys, any news on this? I'm in great need of this featuring and looking to contribute this to the drivers. Wanted to know how it's the best way to handle this change on the driver interface.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants