Is there a way to force docker-machine to create the docker vm with a specific ip (assuming that ip is available)?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
That is actively requested in
docker/machine
issue 1709The current workaround:
Michele Tedeschi (
micheletedeschi
) addsI've updated the commands with:
(replace
prova-discovery
by the name of your docker-machine)Here is the (Windows) script (
dmvbf.bat
) I now use, based on what is above:(Note: on Windows 10, Monty Wild comments that it is
udhcpc.eth0.pid
, notudhcpc.eth1.pid
)I start the vm (
docker-machine start <machine-name>
), and then:I do that only once.
At the next
docker-machine start <machine-name>
, the IP will be 192.168.99.101.I changed the DHCP range of VirtualBox. Made both upperbound and lowerbound to 192.168.99.100 and restarted the docker machine. To change the range go to VirtualBox->Files->host network manager->chose the appropriate adapter->change the upperbound.
My workaround was to watch what VBoxNet the docker machine was attached to and then I went into VirtualBox to reset the DHCP range to deliver only the IP I wanted the machine to have.