如何运行在不同的机器泊坞窗容器 [英] How to run docker containers on different machines
问题描述
我设置几个搬运工容器我的应用程序:
- MySQL的容器
- 应用程序服务器(tomcat7)容器
- 对于nginx的容器
- 对于Python龙卷风应用程序容器
在我的本地机器上,使用泊坞窗机
,我已经尝试了所有这些容器和它们彼此互动。我创建了一个VirtualBox虚拟机boot2linux和设置的所有这些容器就可以了。
现在,生产我要在单独的服务器上运行这些容器中的每一个。有什么泊坞窗提供了快速/轻松地做到这一点?或者我应该建立在每个服务器上泊坞窗,相关的图像复制到该服务器,然后手动启动泊坞窗的图像在所有服务器上?
或者我应该设置泊坞窗每个服务器上,相关的图像复制到该服务器,然后手动启动所有服务器上泊坞窗的图像?
块引用>是的,但你也应该:
- 创建的的相关libnetworks为了了解在他们注册的容器
- 创建作为第一个容器中的 KV一(键值:领事ETCD,动物园管理员,...)了将监督每一个网络(/机)每个容器,让他们看到彼此。结果
注意:您可能需要使用一个码头工人1.10添加网络范围的别名,你的容器然后你就可以在你的机器创建容器。
I've setup several docker containers for my application:
- container for mysql
- container for application server (tomcat7)
- container for nginx
- container for python tornado application
On my local machine, using
docker-machine
, I've tried all these containers and them interactive with each other. I created one virtualbox machine with boot2linux and setup all these containers on it.Now, for production I am going to run each one of these containers on a separate server. Is there something docker provides to quickly/easily do this? Or should I set up docker on each server, copy relevant images to that server, and then start docker-images manually on all servers?
解决方案Or should I set up docker on each server, copy relevant images to that server, and then start docker-images manually on all servers?
Yes, but you should also:
- create the relevant libnetworks in order for your containers to be registered in them
- create as first container a KV one (Key-Value: Consul, etcd, Zookeeper, ...) that will monitor each containers in each network(/machine), allowing them to see each others.
Note: you might want to use a docker 1.10 for adding a network-scoped alias to your containers.Then you can create your containers on your machines.
See a practical example at Understand Docker container networks
这篇关于如何运行在不同的机器泊坞窗容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!