尝试使用自定义运行时在Google App Engine上安装Nginx

时间:2018-10-24 21:07:50

标签: docker google-app-engine dockerfile

我一直在尝试在Google App Engine上部署Flask应用程序,但无法在docker容器中安装nginx。

我正在使用带有自定义运行时的flex env

这是我的app.yaml:

runtime: custom
api_version: 1
service: dev
env: flex

这是我的Dockerfile:

FROM gcr.io/google-appengine/python

RUN virtualenv /env -p python3.6

ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH

ADD app/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt

ADD /app /app

RUN apt-get -q update && \
    apt-get -y -q upgrade && \
    apt-get install -y nginx

RUN mkdir -p /var/log/app_engine
RUN mkdir -p /usr/share/nginx/www/_ah && \
    echo "healthy" > /usr/share/nginx/www/_ah/health

CMD gunicorn -b :$PORT main:app

这是控制台日志:

Step 9/12 : RUN apt-get install -y nginx
---> Running in 3990d1fb6405
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nginx
The command '/bin/sh -c apt-get install -y nginx' returned a non-zero code: 100
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 100

非常感谢您的帮助

0 个答案:

没有答案