Docker Community Forums

Share and learn in the Docker community.

Keep IP of docker.local host between restarts


(Tim Haak) #1

Expected behavior

That between restarts the ip of docker.local host ip stays the same.

Actual behavior

Keep’s chaning ie 192.168.64.5 then 192.168.64.6 etc

###Reasoning
This isn’t a bug but I can see it confusing people especially people who are learning.

The main reason being that unless a user knows how to set something up that does a cname they will have to manually edit /etc/hosts or something similar to point a dns entry at docker.local. I.e dev.example.com.

Then change it each time it changes.


(Elliot Wright) #2

One other thing about this. Coming from Docker Machine, I used dnsmasq to set up a wildcard domain name @ *.docker.local. This meant I could just stick a project name in front, and use that to make navigating to projects in a browser much easier (i.e. the history would be kept separate). The problem is, I don’t want to have to change the dnsmasq configuration file every time the VM gets restarted.

It’d be great to be able to choose an IP address that it would run on. I did try it with hostnet and a specific host and docker IP there, but I’m a little confused by the option to specify IP addresses as hostnet seems to be designed to use your host address anyway.

In any case, being able to choose a static IP address would be awesome.


(Dave Barnwell) #3

Likewise I use dnsmasq and the IP address changing on each restart is a real pain now, as I have to edit my dnsmasq config each day. So an option to set the IP address would be great.


(Chulki Lee) #4

localhost is now used for port forwarding by default.docker.local will no longer work as of Beta 9.

So you can just use 127.0.0.1.


(Tim Haak) #5

Yup :smile:

Busy using it and much better.