docker - App Engine 灵活环境 - 安装过时版本的 GDAL 的 Dockerfile

标签 docker ubuntu google-app-engine dockerfile gdal

我正在尝试在 Google App Engine 灵活环境中使用 Docker 镜像。

FROM ubuntu:bionic
MAINTAINER Makina Corpus "contact@makina-corpus.com"

ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8

RUN apt-get update -qq && apt-get install -y -qq \
    # std libs
    git less nano curl \
    ca-certificates \
    wget build-essential\
    # python basic libs
    python3.8 python3.8-dev python3.8-venv gettext \
    # geodjango
    gdal-bin binutils libproj-dev libgdal-dev \
    # postgresql
    libpq-dev postgresql-client && \
    apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/*

# install pip
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.8 get-pip.py && rm get-pip.py
RUN pip3 install --no-cache-dir setuptools wheel -U

CMD ["/bin/bash"]

docker 镜像似乎可以正确构建,但是当服务部署应用程序崩溃时,我收到以下错误消息:
  File "/Users/NAME/Documents/gcp/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 183, in IsDone
    encoding.MessageToPyValue(operation.error)))
OperationError: Error Response: [9] 
Application startup error! Code: APP_CONTAINER_CRASHED

ERROR: (gcloud.app.deploy) Error Response: [9] 
Application startup error! Code: APP_CONTAINER_CRASHED

这是失败的,因为 Dockerfile 正在安装一个明显过时的 GDAL 包版本,它与最新的 python 安装冲突。

如何确保 dockerfile 具有正确的包存储库并安装正确的最新版本?在开始安装之前,我可以插入一些行来更新存储库,或者至少打印存储库吗?

编辑:

我的 app.yaml:
# [START django_app]

runtime: custom
env: flex
entrypoint: gunicorn -b :$PORT MyApplication.wsgi

runtime_config:
  python_version: 3
# [END runtime]

handlers:
# This configures Google App Engine to serve the files in the app's static
# directory.
#- url: /static
#  static_dir: static/
#- url: /MyApplication/static
#  static_dir: MyApplication/static/


# This handler routes all requests not caught above to your main app. It is
# required when static routes are defined, but can be omitted (along with
# the entire handlers section) when there are no static files defined.
- url: /.*
  script: auto
# [END django_app]

resources:
  cpu: 1
  memory_gb: 2
  disk_size_gb: 10

最佳答案

您的 App Engine 部署失败,因为它 needs a service listening on port 8080它不能在云上运行 bash。如果您需要调试您的 App Engine Flex 实例,您需要首先在端口 8080 and then enable SSH 上获取服务.

关于docker - App Engine 灵活环境 - 安装过时版本的 GDAL 的 Dockerfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61390259/

相关文章:

ruby-on-rails - Rails 看不到环境变量

java - 为什么我在使用 Google App Engile 的端点插入数据时在 Android 中出现错误?

python - 谷歌应用引擎开发服务器(python)上的自动任务执行

node.js - Docker 构建 npm 错误日志

linux - Docker:安装/共享单个 sock 文件?

linux - 文件解压再压缩后md5不一样

regex - 使用 bash 在 Ubuntu 或 Debian 上获取 IP 地址信息(网关和子网)

mongodb - 在 Alpine 镜像上安装 MongoDB 时出现问题

docker - 在tarball上使用docker load时,我得到了无效的参数

java - 这是我在 Google MySQL 中的 "instance name"