search

Home  >  Q&A  >  body text

boot2docker 执行docker命令的时候报这个x509异常

An error occurred trying to connect: Get https://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

我查过其他人给的解决方法,是执行 boot2docker delete,然后重新初始化。
那样我下载的镜像全部都木有了,工作又要全部重新做。
有人有其它的解决方案吗?

PHPzPHPz2858 days ago782

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-04-22 08:58:03

    Run boot2docker ssh into the virtual machine first
    Run sudo vi /var/lib/boot2docker/profile Add the following:

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

    Runexit 退出虚拟机后,运行 boot2docker stop Just close the virtual machine and reopen it.

    Remember to run it before opening a new terminal to execute the docker command eval "$(boot2docker shellinit)"

    Reference https://gist.github.com/garthk/d5a17007c277aa5c76de

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-22 08:58:03

    Use the following command:

    boot2docker ssh sudo /etc/init.d/docker restart

    reply
    0
  • Cancelreply