App Engine灵活环境-Dockerfile安装过时版本的GDAL
我正试图在Google App Engine Flexible环境中使用Docker图像App Engine灵活环境-Dockerfile安装过时版本的GDAL,docker,ubuntu,google-app-engine,dockerfile,gdal,Docker,Ubuntu,Google App Engine,Dockerfile,Gdal,我正试图在Google App Engine Flexible环境中使用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
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
您的应用程序引擎部署失败,因为它无法在云上运行bash。如果需要调试App Engine Flex实例,首先需要在端口8080上获得服务。类似的问题正在得到解决和解决 Dockerfile应运行一个命令,以启动侦听端口8080的应用程序:
CMD gunicorn -b :$PORT MyApplication.wsgi
GAE实际上使用docker run
来启动容器,我不确定为什么它们也会在app.yaml
文件中指定entrypoint
。最好不要问GAE太多问题
上面的一些评论中提到了您需要考虑的其他问题:
- 使用谷歌的GAE基础图像(如上面的一些评论中所提到的)->
,不是更好吗从gcr.io/Google appengine/python
- 如果是这样,您需要考虑它是基于Ubuntu 16.04的,并且您需要更新依赖关系(通过添加UbuntuGIS PPA:<代码> Apple存储库-Y PPA:UbuntuGIS/PPA)
- 如何安装其他依赖项?使用需求文件运行
pip