Why do we need to care about the container?

Alt
Alt
Why should we care about Docker?

it is good. The first question: What is the Docker?

If you're a developer, you may encounter the following problems: The software can run on the machine, but it can not work in a test environment. So, Docker at the most basic level to solve this problem.


Docker When did you start work?

Alt
Docker play a role in the software development life cycle (SDLC) of the deployment phase. It simplifies the process of deploying applications to solve a lot of issues.

Docker is doing what?

Software is not just a piece of code. It consists of a front-end server, database, envelopes, library dependencies and composition, we must ensure that all components are working properly, and the software can run on all platforms, including: mobile phones, tablets, computers, and all the different operating systems. If we draw a picture of all components and platforms, we will see each of the components are connected to each platform - looks like a neural network, like!

You can use a simple analogy to understand this: Imagine that you want to move, you have to go to a different country with all that stuff. You move things come in different sizes and shapes have different requirements (fragile, "gently", etc.). You have to consider transportation, packaging, professional labor, transportation. But if you have a container, then all these problems will disappear and you have to do is put your things intact, properly packaged in containers.

Alt
Docker is a tool to easily deploy and run applications through the use of containers. Docker allows developers to all parts of the application and the desired (e.g., libraries and dependencies) packaged together and sends them out as a package. Docker by sending it to a destination and run it to handle the rest of the work on all possible platforms.

Developers need to consider is how to develop software, they only need to package it, without the need to consider the needs of the operating platform.


How to create a Docker container

Alt
Docker file used to build a Docker image that will also include all the items code. Docker same image can be used to rotate a plurality of containers, each container of the underlying image has been modified. The final image can be uploaded to the central Docker and share with other collaborators for testing and deployment. Therefore, building Docker image will be your main challenge. Docker containers Docker image is just an example.

definition

Docker文件:一个文本文档,包含了用户可以在命令行上调用的用来组装图像的所有命令。
Docker镜像:一种只读模板,用于创建Docker用户构建的容器;它将存储在Docker中心或本地注册表中。
Docker容器:独立的应用程序平台,包含了运行由一个或多个映像构建的应用程序所需的一切。

Alt


什么是Docker Compose?

通常,我们使用一个容器来承载一个服务器。考虑一个使用许多web服务器的大型产品,这些服务器必须单独或在单独的虚拟机(vm)中运行。

在这种情况下,运行这么多不同的vm会使计算机过热并降低所有进程的速度。但是,我们有一个单独的容器,叫做Docker Compose,它将包含一个Docker Composer。如果我们在编写器中有两个Docker映像,它将在两个实例中运行,允许它们彼此交互并监视它们。

假设你正在使用MongoDB、Express、Angular和Node.js开发一个全堆栈应用程序。您必须使用三个包含三个容器的Docker文件。一个容器用于MongoDB作为数据库;一个容器用于服务器,它是Express和Node.js的组合;另一个容器用于Angular(前端客户端)。

Alt
如果你不知道完整堆栈应用程序是如何工作的,那么你首先需要了解用户所在的客户端。用户向应用程序发送请求,然后应用程序将请求发送到服务器。服务器(即后端)执行所有的功能。然后,服务器从数据库(本例中为MongoDB)获取数据,并将其发送到用户的前端。容器中的所有Docker文件都由用YAML编写的Docker撰写文件控制。在YAML文件中,你必须指定容器的位置,以及Composer与其他容器交互时所必须使用的端口号。

简单来说,Docker组合用于运行多容器应用程序。每个容器将运行一个独立的应用程序,它可以与同一主机中的每个容器通信。

Docker uses a client - server architecture. See the picture below explained.
Alt

Original link: https://medium.com/better-programming/why-should-you-care-about-containerizing-45383062d4df

Alt
The above information comes from the Internet, compiled by "Jingdong cloud developer community" public editor numbers do not represent the position of Jingdong cloud.

Click " Jingdong cloud " is understood Jingdong cloud native container products

Alt

Guess you like

Origin www.cnblogs.com/jdclouddeveloper/p/11670677.html