如何在不同机器上运行码头容器 [英] How to run docker containers on different machines

查看:173
本文介绍了如何在不同机器上运行码头容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的应用程序设置了几个docker容器:


  1. 容器为mysql

  2. 应用程序服务器容器(tomcat7)

  3. 容器for nginx

  4. 容器for python龙卷风应用程序

在本地机器上,使用 docker-machine ,我已经尝试了所有这些容器和它们之间的互动。我用boot2linux创建了一个虚拟机,并在其上设置所有这些容器。



现在,对于生产,我将在单独的服务器上运行这些容器中的每一个。 Docker有什么可以快速/轻松地做到这一点吗?或者我应该在每个服务器上设置Docker,将相关图像复制到该服务器,然后在所有服务器上手动启动docker-images?

解决方案

或者我应该在每个服务器上设置docker,将相关图像复制到该服务器,然后在所有服务器上手动启动docker-images?


是的,但您也应该:




  • 创建



    然后,您可以在计算机上创建容器。



    请参阅了解Docker容器网络


    I've setup several docker containers for my application:

    1. container for mysql
    2. container for application server (tomcat7)
    3. container for nginx
    4. 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:

    Then you can create your containers on your machines.

    See a practical example at Understand Docker container networks

    这篇关于如何在不同机器上运行码头容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆