【问题标题】:error using gcp cloud build to create dockerfile使用 gcp 云构建创建 dockerfile 时出错
【发布时间】:2019-04-23 12:23:32
【问题描述】:

我正在尝试使用 google cloud platform\cloud build 和快速入门 guide 构建 dockerfile。我在 google shell 中输入步骤但得到错误

-bash: FROM: command not found

在命令 FROM alpine 上(准备源文件,步骤 2)。

我一定是犯了一个基本错误,我假设 cloud build 可以创建一个 dockerfile,并且在 FROM alpine 命令之前需要输入一个命令吗?

【问题讨论】:

    标签: docker google-cloud-platform dockerfile google-cloud-build


    【解决方案1】:

    您需要使用vi 等编辑器创建一个名为Dockerfile 的文件。然后在文件中输入命令并保存。

    您尝试将 Dockerfile 语句输入您的 shell。

    【讨论】:

    • 谢谢约翰。我已经创建了文件,但是当我从保存文件的文件夹中的 Windows 终端输入命令 chmod +x quickstart.sh 时,我收到另一个错误 "chmod" is not recognized as an internal or external command,operable program or batch file.
    • 您是如何将 Powershell 安装到您的 gcloud shell 中的?
    • 我没有在gcloud shell中打开Powershell,只是自己打开的。我现在使用 Notepad++ 创建了文件,在 Windows (https://www.youtube.com/watch?v=xzgwDbe7foQ) 上安装了 linux/bash 并继续阅读快速入门指南
    • John 在执行此命令时gcloud builds submit --tag gcr.io/[PROJECT_ID]/quickstart-image . 我收到错误gzip: stdin: invalid compressed data--format violated。我使用 Notepad++ 创建了 Dockerfile 和 quickstart.sh 文件,这是正确的方法吗?
    • @Zeus - 打开一个新问题,我会帮助你。 StackOverflow 不赞成长评论线程。在这里告诉我问题的 URL。
    猜你喜欢
    • 1970-01-01
    • 2018-04-23
    • 2017-04-06
    • 2023-01-26
    • 2019-10-29
    • 2020-10-17
    • 1970-01-01
    • 2016-07-07
    • 2018-08-05
    相关资源
    最近更新 更多