问题描述
在过去的几个星期,我一直在使用 gcloud docker push
推动图片的很多问题。我已经阅读了许多堆栈溢出讨论和github问题和解决方法,但我还没有遇到一个解决方案的不一致。
I have been having a lot of problems pushing images with gcloud docker push
over the past few weeks. I've read through the many stack overflow discussions and github issues and workarounds but I haven't come across a solution to the inconsistency yet.
通常我会尝试推一个容器图像或两个。第一次推送将几乎总是失败,并重试以下重试输出:
Typically I will attempt to push a container image or two. The first push will almost always fail with the following retry-until-timeout output:
我只能用 gcloud auth login
来解决。最多5分钟后,我将尝试推第二张图片,并再次看到重试至超时问题。我会每次尝试看到这一点,直到我 gcloud auth login
再次。
I can only get around it with gcloud auth login
. At most 5 minutes later I will attempt to push a second image, and will again see the retry-until-timeout issue. I will see this on every attempt until I gcloud auth login
again.
通常我将不得不手动重试几个在图像实际推送之前,在认证后立即更多次。
Often I will have to manually retry several more times immediately after authenticating before the image is actually pushed.
- 我实际上正在注销(我仍然可以访问pod和实例等与
kubectl
和gcloud
机器)?如果是这样,为什么要注销不一致,建立码头集装箱的做法会使我的本地gcloud会话无效? - 如果没有,为什么我不能
gcloud docker push
直到我再次验证?之后,为什么这还是不一致的(我怀疑它可能与真正的问题有很大的关系)。 - 有没有办法在Docker机器上推送OSX的图像和gcloud docker推可靠吗?有没有另外一种方法来获取图片到云库(最好是从命令行)?
- Am I actually being logged out (I can still access pods and instances, etc with
kubectl
andgcloud
machines)? If so, why is being logged out inconsistent and what does building docker containers do that it would invalidate my local gcloud session? - If not, why can't I
gcloud docker push
until I authenticate again? After that, why is this still inconsistent (I suspect it may have little or nothing to do with the real issue). - Is there a way to make pushing images on OSX with docker-machine and gcloud docker push reliable? Is there another way to get images to the cloud repository (preferably from the command line)?
gcloud - -version
alpha 2016.01.12
beta 2016.01.12
bq 2.0.18
bq-nix 2.0.18
core 2016.02.11
core-nix 2016.02.05
gcloud
gsutil 4.16
gsutil-nix 4.15
kubectl
kubectl -darwin-x86_64 1.1.7
docker --version
Docker版本1.10.1,build 9e83765
docker-machine - -version
docker-machine版本0.6.0,build e27fb87
virtualbox version 5.0.14 r105127
virtualbox version 5.0.14 r105127
推荐答案
我从来没有遇到过您所提到的问题, gcloud docker
,但是关于你的最后一点,
I never faced the problems you mentioned with
gcloud docker
, but regarding your last point,
i确实有可能不经过gcloud推送到gcr.io repos,例如:
it is indeed possible to push to the gcr.io repos without going through gcloud, e.g:
docker login -e dummy@example.com -p $(gcloud auth print-access-token) -u _token https://gcr.io
docker push [your-image]
对mattmoor的信用,原始答案中的更多信息:
Credits to mattmoor, more info in original answer here:Access google container registry without the gcloud client
这篇关于gcloud docker推送可靠性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!