【问题标题】:ERROR: (gcloud.app.deploy) You must provide your own Dockerfile when using a custom runtime错误:(gcloud.app.deploy)您必须在使用自定义运行时提供自己的 Dockerfile
【发布时间】:2020-05-31 20:49:15
【问题描述】:

我正在尝试使用 App Engine 在 Google Cloud 上安排 R 作业。我在关注文章

https://code.markedmondson.me/4-ways-schedule-r-scripts-on-google-cloud-platform/

但是,当我尝试使用 gcloud app deploy --project shiny-demo 部署应用程序时,我收到以下错误

Enabling service [appengineflex.googleapis.com] on project [shiny-demo]...
Waiting for async operation operations/acf.33c5e6da-6f9e-4e66-b7d3-f0611eddc0ce to complete...
Operation finished successfully. The following command can describe the Operation details:
 gcloud services operations describe operations/tmo-acf.33c5e6da-6f9e-4e66-b7d3-f0611eddc0ce
Beginning deployment of service [default]...
ERROR: (gcloud.app.deploy) You must provide your own Dockerfile when using a custom runtime. Otherwise provide a "runtime" field with one of the supported runtimes.

我的 yaml 文件所在的文件夹中确实有一个 Dockerfile,但不知何故,它无法识别 Dockerfile。以下是我的 yaml 文件:

# app.yaml file
runtime: custom
env: flex

manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

env_variables:
  GCS_AUTH_FILE: authkey.json

我的 Dockerfile:

# DOCKER
FROM trestletech/plumber
LABEL maintainer="mark"
RUN export DEBIAN_FRONTEND=noninteractive; apt-get -y update \
 && apt-get install -y libcairo2-dev \
    libcurl4-openssl-dev \
    libgmp-dev \
    libpng-dev \
    libssl-dev \
    libxml2-dev \
    make \
    pandoc \
    pandoc-citeproc \
    zlib1g-dev
RUN ["install2.r", "-r 'https://cloud.r-project.org'", "readr", "googleCloudStorageR", "bigrquery", "Rcpp", "digest", "crayon", "withr", "mime", "R6", "jsonlite", "xtable", "magrittr", "httr", "curl", "testthat", "devtools", "hms", "shiny", "httpuv", "memoise", "htmltools", "openssl", "tibble", "remotes"]
RUN ["installGithub.r", "MarkEdmondson1234/googleAuthR@7917351", "hadley/rlang@ff87439"]
WORKDIR /payload/
COPY [".", "./"]

EXPOSE 8080
ENTRYPOINT ["R", "-e", "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=8080)"]
CMD ["myscript.R"]

我对 Docker 有点陌生。

为文件夹结构添加图片:

【问题讨论】:

    标签: r docker google-app-engine google-cloud-platform yaml


    【解决方案1】:

    您的 Dockerfile 名称是 Dockerfile(第一个字母大写)吗?

    Windows 有时会在内部将文件保存为 .txt

    A Dockerfile must be created with no extension. 要在 Windows 中执行此操作, 使用您选择的编辑器创建文件,然后使用 表示法“Dockerfile”(包括引号)。

    您在right path 中的Dockefile 是否与app.yaml 处于同一级别?

    【讨论】:

    • 是的,我已经确定了。我已经更新了文件夹结构供您参考
    • 你能检查一下你的Dockerfileno extensions吗?
    • 这将是我可能犯的最愚蠢的错误之一。 Dockerfile 以扩展名 .txt 保存。我删除它工作。非常感谢您的帮助。你知道关于包 rga 及其身份验证流程的任何信息吗
    • 随意创建另一个带有相应标签的问题!
    猜你喜欢
    • 1970-01-01
    • 2018-08-13
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 2016-04-01
    • 2022-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多