Docker机器超时-如何在不破坏机器的情况下进行修复? [英] Docker machine timeout - how to fix without destroying the machine?

查看:125
本文介绍了Docker机器超时-如何在不破坏机器的情况下进行修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Docker Machine上经常遇到问题-每隔几天它就会决定超时,一旦发生这种情况我将无法恢复.

示例

docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default            virtualbox   Timeout

环境信息

uname -a                 Darwin ColeyMBPR 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
docker version           1.11.0
docker-machine version   0.7.0
vboxmanage --version     5.0.20r106931

尝试的解决方案

我没有特别顺序地尝试以下操作:

  • 重新启动docker计算机.
  • 运行eval "$(docker-machine env default)"
  • 重新生成证书docker-machine regenerate-certs default
  • 重新启动主机箱.
  • 升级Docker.
  • 重新安装Docker.
  • 升级VirtualBox.
  • 删除所有VirtualBox仅限主机的网络设备.

黑客

对我来说唯一有效的方法是销毁docker计算机并重新创建它.这会破坏我所有的图像和容器,并且重新设置它非常耗时.

docker-machine rm -y default && docker-machine create -d virtualbox default && eval $(docker-machine env)

有什么可以尝试的吗?谢谢!


更新:5月9日(复制步骤)

我可以通过以下步骤可靠地重现此问题:

  1. 从新创建的Docker计算机开始.
  2. 使用docker-compose up来构建一些容器.
  3. 在运行容器的情况下关闭计算机.
  4. 重启后,由于Docker计算机超时,Docker CLI无法正常工作.

解决方案

此命令对Digitalocean驱动程序有效:

docker-machine ls -t 20

默认超时时间为10秒似乎太短了./p>

I'm having a recurring problem with Docker Machine - every few days it decides to timeout and I am unable to recover it once this happens.

Example

docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default            virtualbox   Timeout

Environment Info

uname -a                 Darwin ColeyMBPR 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
docker version           1.11.0
docker-machine version   0.7.0
vboxmanage --version     5.0.20r106931

Attempted Solutions

I've tried the following things in no particular order:

  • Restarting the docker machine.
  • Running eval "$(docker-machine env default)"
  • Regenerating the certificates docker-machine regenerate-certs default
  • Restarting my host box.
  • Upgrading Docker.
  • Reinstalling Docker.
  • Upgrading VirtualBox.
  • Removing all VirtualBox host-only network devices.

Hack

The only thing that's working for me right now is destroying the docker machine and recreating it. This destroys all my images and containers, and it's incredibly time consuming to set it up again.

docker-machine rm -y default && docker-machine create -d virtualbox default && eval $(docker-machine env)

Is there anything I can try? Thanks!


Update: 9th May (Steps to Reproduce)

I can reliably reproduce this problem with the following steps:

  1. Start with a freshly created Docker machine.
  2. Use docker-compose up to build some containers.
  3. Shutdown the computer with the containers running.
  4. After reboot the Docker CLI doesn't work due to the Docker machine timing out.

解决方案

This command worked for me with the digitalocean driver:

docker-machine ls -t 20

It seems as though the default timeout of 10 seconds was too short.

这篇关于Docker机器超时-如何在不破坏机器的情况下进行修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆