简体   繁体   English

Docker apt-get在minikube中失败

[英]Docker apt-get fails inside minikube

I am trying to build a docker image inside minikube on a mac for testing, but when I run apt-get update I get a bunch of failed to fetch messages. 我试图在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.

However when I build the same image on my host it works fine. 但是,当我在主机上构建相同的映像时,它可以正常工作。 Did I miss a network setting when I started minikube that is blocking these sites? 当我启动阻止这些站点的minikube时,是否错过了网络设置?

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

To avoid re-building the docker image you can transfer an image built on your local machine into the minikube VM with: 为了避免重新构建docker映像,您可以使用以下方法将构建在本地计算机上的映像转移到minikube VM中:

docker save <image> | minikube ssh docker load

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

It turns out it was the xhyve driver. 原来是xhyve驱动程序。 When I switched to using virtualbox everything worked out great. 当我切换到使用virtualbox时,一切都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM