Docker apt-get在minikube里面失败了

时间:2017-02-04 00:11:24

标签: macos docker debian apt minikube

我正在尝试在mac上的minikube内构建一个docker镜像进行测试,但是当我运行apt-get update时,我得到了一堆无法获取消息的内容。

Err http://repo.mysql.com jessie InRelease

Err http://repo.mysql.com jessie Release.gpg
  Unable to connect to repo.mysql.com:http:

Err http://httpredir.debian.org jessie InRelease

Err http://httpredir.debian.org jessie-updates InRelease

Err http://httpredir.debian.org jessie Release.gpg
  Cannot initiate the connection to httpredir.debian.org:80 (2001:41c8:1000:21::21:35). - connect (101: Network is unreachable) [IP: 2001:41c8:1000:21::21:35 80]
Err http://httpredir.debian.org jessie-updates Release.gpg
  Cannot initiate the connection to httpredir.debian.org:80 (2001:41c8:1000:21::21:35). - connect (101: Network is unreachable) [IP: 2001:41c8:1000:21::21:35 80]
Err http://security.debian.org jessie/updates InRelease

Err http://security.debian.org jessie/updates Release.gpg
  Cannot initiate the connection to security.debian.org:80 (2610:148:1f10:3::73). - connect (101: Network is unreachable) [IP: 2610:148:1f10:3::73 80]
Reading package lists...
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/InRelease  

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease  

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  

W: Failed to fetch http://repo.mysql.com/apt/debian/dists/jessie/InRelease  

W: Failed to fetch http://repo.mysql.com/apt/debian/dists/jessie/Release.gpg  Unable to connect to repo.mysql.com:http:

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg  Cannot initiate the connection to httpredir.debian.org:80 (2001:41c8:1000:21::21:35). - connect (101: Network is unreachable) [IP: 2001:41c8:1000:21::21:35 80]

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg  Cannot initiate the connection to httpredir.debian.org:80 (2001:41c8:1000:21::21:35). - connect (101: Network is unreachable) [IP: 2001:41c8:1000:21::21:35 80]

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Cannot initiate the connection to security.debian.org:80 (2610:148:1f10:3::73). - connect (101: Network is unreachable) [IP: 2610:148:1f10:3::73 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.

然而,当我在我的主机上构建相同的图像时,它工作正常。 当我启动阻止这些网站的minikube时,我是否错过了网络设置?

启动minikube我运行minikube start --vm-driver=xhyve

2 个答案:

答案 0 :(得分:1)

为避免重建docker镜像,您可以将本地计算机上构建的图像传输到minikube VM中:

docker save <image> | minikube ssh docker load

来自:https://twitter.com/markoluksa/status/828996606477422592

答案 1 :(得分:0)

事实证明这是xhyve的驱动程序。当我切换到使用virtualbox时,一切都很顺利。