How can I specify the IP when restart/create a VMs?

How can I specify the IP when restart/create a VMs?
Hi !
I’m a newer in docker.today I stduy the docker follow the “https://docs.docker.com/get-started/”.

everything goes right.But, when I restart one VM, It show me a error.that “Unable to query docker version…”, for it;s IP changed!

even though, By using [regenerate-certs] can fixed, But,I wanna kown, how to specfiy the VM’s IP when create or start? , for,when we deploy our app to the net, the IP port can not changed.

Who shall lead me to solve this puzzle?

thank you very much!


below is the slot.

Administrator@USER-6SKSMQTFIH MINGW64 ~
$ docker-machine.exe restart myvm1
Restarting “myvm1”…
(myvm1) Check network to re-create if needed…
(myvm1) Waiting for an IP…
Waiting for SSH to be available…
Detecting the provisioner…
Restarted machines may have new IP addresses. You may need to re-run the docker-machine env command.

Administrator@USER-6SKSMQTFIH MINGW64 ~
$ docker-machine.exe ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.102:2376 v17.09.0-ce
myvm1 - virtualbox Running tcp://192.168.99.100:2376 Unknown Unable to query docker version: Get htt
myvm2 - virtualbox Stopped Unknown

How can I specify the IP when restart/create a VMs?

would that help?

thanks your reply.
I will try that, thanks again.:grinning: