Docker,我有一个包含应用程序服务器的文件夹。什么可以用作容器? [英] Docker, I have one folder that contains the application server. What can be used as a container?

查看:94
本文介绍了Docker,我有一个包含应用程序服务器的文件夹。什么可以用作容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下,是否有一个包含应用程序服务器的文件夹(Axis2,Tomcat,WSO2,mongodb和jms-consumer)可以用作容器吗?

I want to ask, if I have one folder that contains the application server (Axis2, Tomcat, WSO2, mongodb, and jms-consumer) What can be used as a container?

Docker是否是应用程序安装程序?它将整个应用程序分类,因此将1用作安装程序文件,例如:Windows的 server.exe ,Windows的 server.deb for ubuntu

Is Docker as an application installer? Which classifies the entire application so 1 is then used as installer file, for example: server.exe for windows, server.deb for ubuntu

可以帮助解释吗?

推荐答案


作为应用程序安装程序的Docker?

Docker as an application installer?

不,Docker是一个管理容器的平台(隔离的用户/进程) /运行主机内核的磁盘计算机),构建,运输和运行(容器即服务)。

No, docker is a a platform which manages containers (isolated user/process/disk machines running with the host kernel), around building, shipping and running (Containers as a Service).

最佳实践是将全局服务的每个部分都隔离在自己的容器中,这都是因为 PID1僵尸获取问题(在 在Docker中使用Supervisor 中详细介绍),以及

如果每个组件仅代表Tomcat,则Mo ngoDB,一个...,每个容器都更易于管理/调试,而不是拥有一个巨型容器。

另外,您可以停止/更新一个容器而不必先使用 all

The best practice is to isolate each part of your global service in its own container, both because of the PID1 zombie reaping issue (detailed in "Use of Supervisor in docker"), but also in term of ease of management and update.
If each component only represents a Tomcat, a MongoDB, a..., each one is easier to manage/debug, instead of having one giant container.
Also you can stop/update one without necessarily ipacting all the other ones.

类似于安装的部分用来描述您的环境(包括操作系统和要添加到容器中的应用程序) > Dockerfile :对您的环境需要运行的描述。

有助于构建映像(您需要的所有文件的存档),您可以从中 docker run 一个容器。

The installation-like part is rather the description of your environment (both in term of OS and of applications you want to add to a container) with the Dockerfile: a description of what your environment will need to run.
That helps building an image (sort of archive of all the files you need), from which you docker run a container.

现在,仅这些容器在Linux内核主机(或Windows,通过Linux VM)上作为Linux机器运行。
您还没有在Windows上运行的纯Windows映像/容器(使用Windows Se进行中) rver 2016)。

Right now, those containers only runs as Linux machines on Linux kernel hosts (or on Windows, through a Linux VM).
You don't have yet pure Windows images/containers that runs on Windows (it is in progress, with Windows Server 2016).

那么您能只将一个巨型文件夹中的东西放到Docker容器中吗?

So can you just take what you have in one giant folder and put it in a docker container?

不直接。 Dockerfile的目标是描述如何安装所需的内容。

然后您 docker build ,然后从得到的映像中,您 docker run

Not directly. The goal of Dockerfile is to describe how you would install what you need.
Then you docker build, and from the image you get, you docker run.

但是为了使Docker正确管理该容器的生命周期,最好将容器设置为限于一个进程(而不是trynig在同一个容器空间中运行webapp服务器,mongodb等之类的所有东西)

But in order for docker to manage correctly the lifecycle of that container, it is best if the container is limited to one process (instead of trynig to run everything like a webapp server, a mongodb, and so on in the same container space)

这意味着:


  • 为系统的每个组件描述单独的Dockerfile(构建单独的映像)

  • 在其中运行这些容器

您有一个我的项目中的复杂多组件系统: b2d

这篇关于Docker,我有一个包含应用程序服务器的文件夹。什么可以用作容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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