【发布时间】:2017-05-03 21:49:20
【问题描述】:
我正在为我的应用程序创建一个cloudbuild.yaml 文件寻求帮助。我的应用程序有一个从phython:2-onbuild 派生的基本映像,然后是从该基本映像派生的两个附加映像。我的项目中每个都有三个单独的Dockerfiles。有没有人可以指出我这样做的例子?
例如,我的基础镜像Dockerfile 如下所示:
FROM python:2-onbuild
# This will execute pip install requirements.txt and get all required python packages installed
# It will also ensure the current directly, minus anything in .dockerignore is copied over to the image
# The web server image and the worker image can then simply inherit from this.
随后,我创建了一个 Web 服务器映像和一个工作器映像。该工作人员旨在作为CronJob 运行。
我的网络服务器Dockerfile 是这样的:
FROM myapp-base
RUN chmod +x ./main_runner.sh
RUN chmod +w static/login.html
RUN chmod +w static/index.html
CMD ./main_runner.sh
我的工人Dockerfile 是:
FROM myapp-base
RUN chmod +x worker_runner.sh
CMD python ./run_worker.py
目前,我的本地 docker-compose.yaml 通过创建 myapp-base 图像并通过该名称使其可用,以便其他图像可以从中派生,将它们联系在一起。云构建中的等价物是什么?
【问题讨论】:
标签: google-cloud-platform google-container-registry