1

我正在为 GCE/GCR 上的 docker 映像使用新的触发构建,并且构建似乎总是因超时而失败。虽然 docker 映像已成功构建,但将映像推送到 GCR 似乎有问题。日志如下:

7f88c2269765: Pushed
5d6cbe0dbcf9: Pushed 
e00d971f9164: Pushed 
0dc1f7b171b3: Pushed 
86f67bb3dbbe: Pushed 
ba89c4349922: Pushed 
4c105bb07555: Pushed 
a5fc5fa13b1c: Pushed 
2a2b5addcfa7: Pushed 
4f15d176b911: Pushed 
9685991d91de: Pushed 
5d6cbe0dbcf9: Waiting 
e00d971f9164: Waiting 
0dc1f7b171b3: Waiting 
86f67bb3dbbe: Waiting 
4c105bb07555: Waiting 
ba89c4349922: Waiting 
7f88c2269765: Waiting 
5d6cbe0dbcf9: Preparing 
e00d971f9164: Preparing 
0dc1f7b171b3: Preparing 
86f67bb3dbbe: Preparing 
4c105bb07555: Preparing 
ba89c4349922: Preparing 
7f88c2269765: Preparing 
c70c29a95bd1: Preparing 
a5fc5fa13b1c: Preparing 
4f15d176b911: Preparing 
9685991d91de: Preparing 
2a2b5addcfa7: Preparing 
The push refers to a repository [gcr.io/repo-compute/github-platform/ap] 
Pushing gcr.io/repo-compute/github-platform/ap:8a7ce4a87b24ac8f2c7b00b5719743b7cc81de5b 
PUSH Successfully built e1b3f1ab6e1d Removing intermediate container d696b84e6731
4

1 回答 1

3

使用超时选项并将默认值从 10 分钟增加到 10 分钟:

- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-f=./foo/bar/Dockerfile', '--tag=gcr.io/foo-compute/continuous-deploy/deploy:$COMMIT_SHA', '.']
  waitFor: ['-']
images:
  - 'gcr.io/foo-compute/continuous-deploy/deploy:$COMMIT_SHA'
timeout: '1200s'

注意:超时以秒为单位配置: https ://cloud.google.com/container-builder/docs/api/reference/rest/v1/projects.builds#Build

于 2017-03-22T17:05:10.287 回答