gcloud ping attempt failure with performing a 'docker push'

你。 提交于 2019-12-11 02:34:46

问题


I ran the following command

gcloud preview docker push gcr.io/project-name/an-image

And I got the following error. Does anyone know how I fix that or what it means? All I was doing was following the standard examples just to learn how it works... Thanks :)

FATA[0010] Error: v1 ping attempt failed with error: Get https://gcr.io/v1/_ping: dial tcp: i/o timeout. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry gcr.io to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/gcr.io/ca.crt

ERROR: (gcloud.preview.docker) A Docker command did not run successfully. Tried to run: 'docker push gcr.io/project-name/an-image' Exit code: 1


回答1:


The error means that docker had problem connecting to the https://gcr.io/v1/_ping url, and the tcp connection timed out.

The most likely cause is a fluke in the connection between your ISP and Google. Try running "curl https://gcr.io/v1/_ping" a couple of times and see if it connects correctly (it should return "true" as the body of the request). If not, try pinging gcr.io to see if you can reach the server at all.




回答2:


I ran into this issue, and for me, it was not an ISP issue, curl https://us.gcr.io/v1/_ping worked fine. However, restarting my docker machine did the trick:

docker-machine stop
docker-machine start
@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i
gcloud docker push gcr.io/<project-name>/<an-image>



回答3:


Docker <1.7 has a 5 second timeout for resolving gcr.io, connecting, and performing the ping.

We basically never see this crossing ~100ms once it hits our front-end, and when we've managed to catch consistent failures, it has almost universally been due to slow name resolution.

Fortunately, 1.7 finally raises this to 30 seconds, which should at least mitigate this issue.



来源:https://stackoverflow.com/questions/29202923/gcloud-ping-attempt-failure-with-performing-a-docker-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!