[英]Multiple Services Specified by docker-compose.yml on a Single Google Compute Engine VM
I have a docker-compose.yml
file which specifies two services AAA
and BBB
as follows,我有一个
docker-compose.yml
文件,它指定了两个服务AAA
和BBB
,如下所示,
version: "3.4"
services:
AAA:
platform: linux/amd64
build: .
image: AAA
environment:
- ENV_VAR=1
volumes:
- ./data:/root/data
ports:
- 5900:5900
restart: on-failure
BBB:
image: BBB
build: ./service_directory
platform: linux/amd64
environment:
- PYTHONUNBUFFERED=1
volumes:
- ./data:/root/data
ports:
- 5901:5901
restart: on-failure
depends_on:
- AAA
And here's my directory structure:这是我的目录结构:
project
| docker-compose.yml
| Dockerfile
|
|--service_directory
|
|--Dockerfile
I'm led to believe that google cloud lacks direct docker-compose
support, and one must translate the docker compose script into a cloudbuild.yaml
file.我被引导相信谷歌云缺乏直接
docker-compose
支持,并且必须将 docker 撰写脚本转换为cloudbuild.yaml
文件。
How should one specify the multiple services, the environment
, ports
, volumes
information and the dependency of BBB
on AAA
in a cloudbuild.yaml
file such that both services build on a single compute engine VM instance, as one would otherwise expect from running the docker compose up
command?应该如何在
cloudbuild.yaml
文件中指定多个服务、 environment
、 ports
、 volumes
信息以及BBB
对AAA
的依赖性,以便两个服务都构建在单个计算引擎 VM 实例上,正如人们期望运行docker compose up
命令?
Google Compute Engine VMs (running Linux) are functionally equivalent to any other Linux machine and you can run Docker Compose as you would elsewhere. Google Compute Engine VM(运行 Linux)在功能上等同于任何其他 Linux 机器,您可以像在其他地方一样运行 Docker Compose。
You may need to install Docker and Docker Compose as you would on any Linux host.您可能需要像在任何 Linux 主机上一样安装 Docker 和 Docker Compose。
Google Cloud Build provides different functionality to Docker Compose; Google Cloud Build提供与 Docker Compose 不同的功能; the two are not equivalent.
两者不等同。 Cloud Build is a cloud-based pipeline tool that is mostly used (but is not limited) to define the steps needed to create container images.
Cloud Build 是一种基于云的管道工具,主要用于(但不限于)定义创建容器镜像所需的步骤。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.