【问题标题】:Build trigger failed in Container RegistryContainer Registry 中的构建触发器失败
【发布时间】:2017-06-06 12:39:21
【问题描述】:

我在 Container Registry 中创建了一个触发器。我在 GIT HUB 存储库中有我的脚本。 在 Build trigger 中选择存储库托管选项作为 GitHub 和 Authenticated。

步骤:1:选择 git hub 源代码库

步骤:2:选择我的 git hub 存储库并进行身份验证。

第 3 步:使用 docker 文件选项创建触发器。

第 4 步:触发器运行,构建失败。

构建日志

starting build "5b04afe3-b669-48c6-83b1-58342f918256"

FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/project-id/r/github-dhandapanisattanathan-gcb
* branch 59182f2dd5caffcc224d49299595056afd64d295 -> FETCH_HEAD
HEAD is now at 59182f2 ver 2
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /workspace/Dockerfile: no such file or directory
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:bb4f74d4d598896f932f4d2a5b12b3a816f5f6d3c9cf1f50d0bdd98fd4004d2d" failed: exit status 1

我遇到了这个问题,无法准备上下文:无法评估 Docker 文件路径中的符号链接:lstat /workspace/Dockerfile:没有这样的文件或目录。

我不知道我在这里错过了什么。但是每次推送 git hub 触发器都会自动运行,构建失败。

请帮我解决这个问题。

【问题讨论】:

    标签: github google-cloud-platform google-container-registry


    【解决方案1】:

    /workspace的内容是你的git仓库的内容;在这种情况下,https://github.com/dhandapanisattanathan/gcb。您的存储库没有Dockerfile,因此您不能使用不存在的Dockerfile 进行构建。

    看起来您的存储库用于 GAE 标准应用程序。可能可以将其转换为可运行的容器,但我不知道您将在 Dockerfile 中放入什么来实现它。

    【讨论】:

    • 谢谢,John Asmuth,请指导我如何在我的 GITHUB 中使用 Dockerfile。
    • 有很多教程可以写一个Dockerfile。一旦你有了它,它在你的存储库中的存在将导致你已经创建的构建触发器使用它。 FROM ubuntu 是一个不使用您的容器的简单方法。这将在您构建时推送与ubuntu 相同的图像。
    • 谢谢,John Asmuth,我尝试使用 Dockerfile。我获得了成功。但是我需要在构建触发器之后如何将图像推送到 GAE SE。我更新了我的 dockerfile 并登录了这个链接。 docs.google.com/spreadsheets/d/…帮助我错过了什么?
    • GAE 标准不运行容器镜像。为此,您需要 GAE Flexible,并且可以使用 gcloud app deploy --image_url=gcr.io/yourproject/yourimage 部署映像。
    • 您可以通过在构建中运行 gcloud app deploy --image-url=myimage 从构建触发器进行部署。 ``` - name: 'gcr.io/cloud-builders/docker' args: ['push', 'gcr.io/$PROJECT_ID /my-image'] - 名称:'gcr.io/cloud-builders/gcloud' 参数:['app', 'deploy', '--image-url=gcr.io/$PROJECT_ID/my-image', 'app.yaml'] ```
    猜你喜欢
    • 1970-01-01
    • 2020-06-23
    • 1970-01-01
    • 2016-04-22
    • 1970-01-01
    • 2019-09-25
    • 1970-01-01
    • 2015-01-07
    • 2020-11-20
    相关资源
    最近更新 更多