Boot2docker reported this x509 exception when executing the docker command

  docker, question

An error occurred trying to connect: Gethttps://192.168.59.103:2376/v1.19/images/json: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103

I checked the solution given by others, which is to execute boot2docker delete and reinitialize.
In that way, all the images I downloaded will be gone, and all the work will have to be done again.
Does anyone have other solutions?

Run firstboot2docker sshInto the virtual machine
runsudo vi /var/lib/boot2docker/profileAdd the following:

wait4eth1() {
 CNT=0
 until ip a show eth1 | grep -q UP
 do
 [ $((CNT++)) -gt 60 ] && break || sleep 1
 done
 sleep 1
 }
 wait4eth1

runexitAfter exiting the virtual machine, runboot2docker stopShut down the virtual machine and turn it back on.

Remember to run the docker command when opening the new terminal.eval "$(boot2docker shellinit)"

Referenceshttps://gist.github.com/garthk/d5a17007c277aa5c76de