简体   繁体   English

使用自定义容器部署到App Engine时发生构建错误

[英]Build Error while deploying to App Engine using custom containers

I am using a nodejs based custom deployment on App Engine using google/nodejs-runtime docker image. 我正在使用Google / nodejs-runtime docker映像在App Engine上使用基于nodejs的自定义部署。

I built my code on the localhost via 我通过以下方式在本地主机上构建了代码

gcloud preview app run .

and it runs fine. 而且运行良好。 But when i deploy it to my App Engine using 但是当我使用将其部署到我的App Engine时

gcloud preview app deploy .

it give this error (along with whole stacktrace): 它给出了这个错误(以及整个stacktrace):

Build Error: Get https://index.docker.io/v1/repositories/google/nodejs-runtime/images: dial tcp: lookup index.docker.io on 192.168.2.1:53: no answer from server.

This seems to be error while fetching the repository from the internal google repos. 从内部google仓库中提取存储库时,这似乎是错误的。 Is it? 是吗?

  • If yes, why is this and how can i make sure that this doesn't happen again. 如果是的话,这是为什么?我如何确保不再发生这种情况。
  • If no, then what is it and how do i solve it? 如果没有,那是什么,我该如何解决?

So this is what happens while deploying to the app engine: 因此,这是在部署到应用程序引擎时发生的情况:

  • Docker check for Google's repo for the image, as the image file i am using (google/nodejs-runtime) is by google and hosted on Google as well (i guess). Docker检查图像的Google存储库,因为我正在使用的图像文件(google / nodejs-runtime)由google托管,并且也托管在Google上(我想)。
  • Check for any updates to the docker image and update the image file, this is necessary to always push updated versions to the deployment. 检查docker映像是否有任何更新并更新映像文件,这对于始终将更新的版本推送到部署是必要的。
  • Pull changes and push the image to App Engine server and check if the app is serving. 拉取更改并将图像推送到App Engine服务器,然后检查应用程序是否正在提供服务。

While my assumption was that the issue was in docker registry on Google's end, it was not so. 虽然我认为问题出在Google的docker注册表中,但事实并非如此。

So there were actually two issues which were causing the issue: 因此,实际上有两个问题导致了该问题:

Primary issue (as mentioned in question's comments by @John-Lowry): It was of the error was DNS name resolution to connect to the docker servers. 主要问题(如@ John-Lowry在问题评论中所提到的):出现错误的原因是DNS名称解析已连接到Docker服务器。 This was due to my ISP's DNS issue which was blocking access to the servers. 这是由于我的ISP的DNS问题阻止了对服务器的访问。 Resolved when changed ISP and also resolved after some time on the ISP #1. 更改ISP后已解决,并且在ISP#1上已解决一段时间。

Secondary issue (Not sure if exactly related): Once i switched ISP the following error occurred 次要问题(不确定是否完全相关):一旦我切换了ISP,就会发生以下错误

google.appengine.tools.docker.containers.ImageError: Image with tag google/docker-registry was not found

This was resolved once i updated the image from the server. 我从服务器更新映像后,此问题已解决。 Similar Question And finally the updated app was pushed to the servers. 相似的问题最后将更新的应用程序推送到服务器。

I am not sure why the error occurred, but this is what i assessed: 我不确定为什么会发生错误,但这是我评估的结果:

The docker registry image (google/docker-registry) was updated at some point before the deployment. 部署前的某个时刻,docker注册表映像(google / docker-registry)已更新。 While deployment, the checks were performed for the image in use (google/nodejs-runtime) but since nodejs-runtime is dependent on docker-registry (i am guessing for maintaining various access policies), it was necessary to update to the newer image. 在部署期间,将对使用中的映像(google / nodejs-runtime)进行检查,但是由于nodejs-runtime依赖于docker-registry(我猜是为了维护各种访问策略),因此有必要更新到较新的映像。

Please suggest edits. 请提出修改建议。

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

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