Docker Community Forums

Share and learn in the Docker community.

My IP got changed after Docker installation :(

docker

(Bluemind2005) #1

My previous ip was 192.168.1.3 and it got changed to 192.168.1.8. I wonder why


(Alexandre) #2

It this a problem?

Unless somehow fixed, IP are usually dynamic (in general, not only for Docker)


(Bluemind2005) #3

yes it is a problem. Because I did a fixed IP for the machine with x.x.x.3


(Alexandre) #4

How many device on your machine are requiring IPs? Devices get different IPs all the time, that’s pretty normal behavior.

When you start a Docker machine, there’s a line that warns you about the fact that the IP might have changed: Started machines may have new IP addresses. You may need to re-run the docker-machine env command.

$ docker-machine start
Starting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/alexandre.leveille/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env)

You can have a look at the below thread on how to (kind-of) work around this:


(Bluemind2005) #5

docker-machine command is valid only on windows not Unix and Mac? Also don’t you think that if you are in Prod environment and you had machines with static ip and you supposedly install docker on each machine and its IP has changed?

Isn’t that a risker?

I have total 4VM’s and all of them had a static IP, I installed docker on one of them and its IP changed :worried:


(Alexandre) #6

Can you elaborate on your setup a little? I’m not sure I follow.

docker-machine is available on Linux, Mac and Windows (must install the Toolbox for Mac and Windows)

In production, the machine(s) should be remote host(s) that run 24/7. You would use docker-machine to connect to these hosts with static IPs.

In development, the machine is hosted on your localhost (perhaps through VirtualBox) and may get a different IP each time.

Does this help?
Alexandre


(Bluemind2005) #7

Well I have a static IP from my ISP provider. Secondly I did set static ip by writing it to hosts file and it was same until docker engine got installed. Can it happen that IP is changed because of docker-engine installation.

I have 4 virtual machines on my host(Windows 10). I have a router. and Virtualization Software is Virtual box.

Each of the machine has a fixed IP and It was working perfectly fine until I installed docker-engine.

What makes me wonder is why my IP changed.

Steps taken to set fix IP is as follows:
In Virtual machine settings for all four VM’s, Network 1 is bridged and Network 2 is Host-only. I read that is way you set static IP to your virtual machine.

Does the above step NOT set to static IP?


(Bluemind2005) #8

Previously I could do ssh between the machines which I cannot do now.

All mess just with docker engine installation or is some where my knowledge is failing or is not sufficient.

I really need to get my lab with static ip as it affects my study.


(Bluemind2005) #9

root@jim-Ubuntu1504:~# docker-machine start
Error: No machine name(s) specified and no “default” machine exists.
root@jim-Ubuntu1504:~# docker-machine env
Error: No machine name(s) specified and no “default” machine exists.


(Bluemind2005) #10

Where it says docker-machine for Unix ?


(Alexandre) #11

Docker machine on linux, installation: https://docs.docker.com/machine/install-machine/