无法使用 gcloud build 命令构建。Gcloud “FAILURE”

huangapple go评论88阅读模式
英文:

Cannot build using gcloud build command. Gcloud "FAILURE"

问题

以下是翻译好的内容:

我正在按照教程设置基本的 Google Cloud Run hello world 类型应用程序:

https://cloud.google.com/run/docs/quickstarts/build-and-deploy#java

我执行了以下步骤:

gcloud builds submit --tag gcr.io/PROJECT-ID/helloworld

在我的情况下:

gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld

然后我得到了一个异常:

ERROR: (gcloud.builds.submit) build 522dae9a-ddc3-4add-aeb4-f0a542c33649 完成,状态为“FAILURE”

整个堆栈跟踪看起来像这样:

C:\dev\temp\cloudrun\helloworld>gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld
创建 13 个文件(共 76.4 KiB)的临时 tarball 归档,然后进行压缩。
正在将[.]的 tarball 上传到 [gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz]
已创建 [https://cloudbuild.googleapis.com/v1/projects/whataboutanewproject/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2]。
日志可在 [https://console.cloud.google.com/cloud-build/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2?project=825197540625] 查看。
------------------------------------------------------------------------------------------------------------ 远程构建输出 ------------------------------------------------------------------------------------------------------------
正在启动构建“a71fcef2-d9da-4c6f-a5e8-2b6086c962b2”

FETCHSOURCE
正在提取存储对象:gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973
正在复制 gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973...
/ [1 个文件][ 53.1 KiB/ 53.1 KiB]
操作已在 1 个对象/53.1 KiB 上完成。
BUILD
已经具有镜像(带有摘要):gcr.io/cloud-builders/docker
正在将构建上下文发送到 Docker 守护进程  109.6kB
步骤 1/8 : FROM maven:3.6-jdk-11 as builder
3.6-jdk-11: 正在从 library/maven 拉取
...

为什么会发生这种情况呢?

英文:

I am following the tutorial on how to set up a basic hello world type application on google cloud run :

https://cloud.google.com/run/docs/quickstarts/build-and-deploy#java

I perform the step :

gcloud builds submit --tag gcr.io/PROJECT-ID/helloworld

In my case :

gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld

And I get an exception

ERROR: (gcloud.builds.submit) build 522dae9a-ddc3-4add-aeb4-f0a542c33649 completed with status "FAILURE"

My entire stack trace looks like this :

C:\dev\temp\cloudrun\helloworld>gcloud builds submit --tag gcr.io/whataboutanewproject/helloworld
Creating temporary tarball archive of 13 file(s) totalling 76.4 KiB before compression.
Uploading tarball of [.] to [gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/whataboutanewproject/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2].
Logs are available at [https://console.cloud.google.com/cloud-build/builds/a71fcef2-d9da-4c6f-a5e8-2b6086c962b2?project=825197540625].
------------------------------------------------------------------------------------------------------------ REMOTE BUILD OUTPUT ------------------------------------------------------------------------------------------------------------
starting build "a71fcef2-d9da-4c6f-a5e8-2b6086c962b2"

FETCHSOURCE
Fetching storage object: gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973
Copying gs://whataboutanewproject_cloudbuild/source/1600095894.659957-225401928ec54d23ad36d56f150a2040.tgz#1600095896709973...
/ [1 files][ 53.1 KiB/ 53.1 KiB]
Operation completed over 1 objects/53.1 KiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon  109.6kB
Step 1/8 : FROM maven:3.6-jdk-11 as builder
3.6-jdk-11: Pulling from library/maven
57df1a1f1ad8: Pulling fs layer
71e126169501: Pulling fs layer
1af28a55c3f3: Pulling fs layer
03f1c9932170: Pulling fs layer
881ad7aafb13: Pulling fs layer
9c0ffd4062f3: Pulling fs layer
bd62e479351a: Pulling fs layer
5d4cc47cef87: Pulling fs layer
0c8911cc7703: Pulling fs layer
c19e861fcc5b: Pulling fs layer
03f1c9932170: Waiting
881ad7aafb13: Waiting
9c0ffd4062f3: Waiting
bd62e479351a: Waiting
5d4cc47cef87: Waiting
0c8911cc7703: Waiting
c19e861fcc5b: Waiting
1af28a55c3f3: Verifying Checksum
1af28a55c3f3: Download complete
71e126169501: Verifying Checksum
71e126169501: Download complete
57df1a1f1ad8: Verifying Checksum
57df1a1f1ad8: Download complete
9c0ffd4062f3: Verifying Checksum
9c0ffd4062f3: Download complete
881ad7aafb13: Verifying Checksum
881ad7aafb13: Download complete
03f1c9932170: Verifying Checksum
03f1c9932170: Download complete
5d4cc47cef87: Verifying Checksum
5d4cc47cef87: Download complete
0c8911cc7703: Verifying Checksum
0c8911cc7703: Download complete
c19e861fcc5b: Verifying Checksum
c19e861fcc5b: Download complete
57df1a1f1ad8: Pull complete
71e126169501: Pull complete
1af28a55c3f3: Pull complete
bd62e479351a: Verifying Checksum
bd62e479351a: Download complete
03f1c9932170: Pull complete
881ad7aafb13: Pull complete
9c0ffd4062f3: Pull complete
bd62e479351a: Pull complete
5d4cc47cef87: Pull complete
0c8911cc7703: Pull complete
c19e861fcc5b: Pull complete
Digest: sha256:c3bf5c312b5ad860cfd0b0f7a9b548367fbf2a52a3a786d5ed23742abe2a70db
Status: Downloaded newer image for maven:3.6-jdk-11
 ---> 89d9818b132c
Step 2/8 : WORKDIR /app
 ---> Running in b5b37ac614df
Removing intermediate container b5b37ac614df
 ---> dd90b62db365
Step 3/8 : COPY pom.xml .
COPY failed: stat /var/lib/docker/tmp/docker-builder268680314/pom.xml: no such file or directory
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR: (gcloud.builds.submit) build a71fcef2-d9da-4c6f-a5e8-2b6086c962b2 completed with status "FAILURE"

C:\dev\temp\cloudrun\helloworld>

Why is this happening?

答案1

得分: 1

如John Hanley所说,您的构建缺少pom.xml文件。

英文:

As John Hanley said, your build is missing the pom.xml file.

huangapple
  • 本文由 发表于 2020年9月14日 23:08:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/63887040.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定