是否可以使用单个docker撰写文件在多个主机中创建容器? [英] Is it possible to create container in multiple host using a single docker compose file?
问题描述
不,docker-compose alone不会实现这一点跨多个主机管理容器通常是调度程序的工作。 Docker生态系统:计划和编排是一个较旧的文章,但应该介绍。
Docker提供的调度程序称为Swarm。 使用组合与群组是开始了解如何一起使用的好地方。 / p>
这部分答案是时间有限的,但在导师周有几个免费课程可以用来了解更多关于Swarm的信息。在您的情况下,操作初学者和中级可能很有趣。
I have to create containers in multiple host. I have a dockerfile for each container. I found that docker-compose can be used to run multiple containers from a single yaml file. I have to run containerA in HostA, containerB in HostB and so on.. is it possible to achieve this using docker-compose ? or what is the best way to create container in different host using the dockerfile.
No, docker-compose alone won't achieve this. Managing containers across multiple hosts is generally the job of schedulers. The Docker Ecosystem: Scheduling and Orchestration is an older article, but should give an introduction.
The scheduler provided by Docker is called Swarm. Use Compose with Swarm is a good place to start to understand how to use them together.
This part of the answer is time limited, but during Mentor Week there are a few free courses you can take to learn more about Swarm. In your case Operations Beginner and Intermediate may be interesting.
这篇关于是否可以使用单个docker撰写文件在多个主机中创建容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!