【发布时间】:2019-10-29 13:05:19
【问题描述】:
我正在尝试使用谷歌云构建触发器构建我的 docker 容器。不幸的是,构建没有找到我的 docker 文件。它不在我的存储库的根目录,但我认为我可以指定一个相对路径。显然我配置错误。下面是我的 cloudbuild.yaml 和输出日志。
如果重要的话 - 我的代码在 github 中,但我将触发器配置为从该 repo 中提取。
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '--tag=gcr.io/$PROJECT_ID/domain-session-test:$TAG_NAME'
- '--file=session_server/deployments/DockerFiles/minimal.Dockerfile'
- '.'
- name: 'gcr.io/cloud-builders/docker'
args: ['run', 'gcr.io/$PROJECT_ID/domain-session-test:$TAG_NAME', 'go', 'test']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '-r', 'k8s/*', 'gs://$PROJECT_ID-kubernetes-manifests']
images: ['gcr.io/$PROJECT_ID/domain-session-test:$TAG_NAME']
日志:
starting build "1c4ee154-2c29-4e81-b884-d64c54841d71"
FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/MYURL
* branch c2d8260a49d9972d1b0882c1676184be35b4c33c -> FETCH_HEAD
HEAD is now at c2d8260 triggering a build
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/docker
Step #0: unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
【问题讨论】:
-
查看这篇文章:stackoverflow.com/questions/35511604/… ;)
标签: dockerfile google-cloud-build