【发布时间】:2016-08-08 19:05:16
【问题描述】:
我正在使用custom runtime 部署到应用程序引擎,我注意到当我部署时,应用程序引擎将完全重新构建我的 Dockerfile,而无需任何缓存。这会导致部署花费更长的时间。我不会在部署之间更改我的 Dockerfile。只有我的应用程序代码在改变。这是我的 Dockerfile:
FROM ubuntu
EXPOSE 8080
RUN apt-get update
RUN apt-get install -yq python-crypto python-openssl libffi-dev libssl-dev
RUN pip install --upgrade pip
RUN pip install gunicorn==19.4.5
RUN pip install Flask==0.10.1
RUN pip install PyMySQL==0.7.2
RUN pip install alembic==0.8.5
RUN pip install Flask-Migrate==1.8.0
RUN pip install Flask-CORS==2.1.2
RUN pip install PyCrypto==2.6.1
RUN pip install requests==2.9.1
RUN pip install --upgrade cffi
RUN pip install google-api-python-client==1.5.0
RUN pip install gcloud==0.11.0
# Ensure that Python outputs everything that's printed inside
# the application rather than buffering it.
ENV PYTHONUNBUFFERED 1
ADD . /app/
WORKDIR /app
ENTRYPOINT ["gunicorn", "-b", ":8080", "server:app"]
有没有办法加快我的部署速度?
【问题讨论】:
-
你在使用Container Builder API吗?基于 GCE 的远程构建?本地 Docker 构建?
-
我正在使用应用引擎管理的虚拟机(我认为它使用容器构建器)。我正在使用
gcloud --project myproject preview app deploy --version v1 app.yaml进行部署