Home  >  Article  >  Operation and Maintenance  >  What does docker do?

What does docker do?

coldplay.xixi
coldplay.xixiOriginal
2020-07-22 11:52:0914485browse

The role of docker is: 1. Better utilization of resources; 2. Customization for microservices; 3. Convenient transplantation between cloud service providers; 4. Convenient use of APIs; 5. Convenient technology Innovation.

What does docker do?

The role of docker is:

1. Make better use of resources

The granularity of a virtual machine is a "virtual machine", while the granularity of Docker is a "restricted application". In comparison, Docker takes up less memory and is more lightweight.

For me, this is an advantage of Docker: because I often run multiple Docker applications on my computer, using Docker is simpler and more convenient than using a virtual machine, with finer granularity and continuous tracking. Container status.

2. Customize for microservices

If you have been paying attention to technology news, then you should have heard of the concept of "Microservices". Docker can be combined well with microservices. Conceptually, a microservice is a container that provides part of a complete set of application functionality, and Docker can serve as a microservice container during development, testing, and deployment. Even production environments can deploy microservices in Docker.

3. Porting between cloud service providers

Most cloud hosting providers already fully support Docker. For developers, this means that you can easily switch cloud service providers. Of course, you can also easily move your local development environment to a cloud host. There is no need to configure the running environment locally and configure it on the cloud host. Also configure the running environment once. Comprehensive deployment of Docker (Docker here and Docker there) as a standard operating environment can greatly reduce the workload and generate bugs when the application is online.

4. API side

API is the glue between applications. A qualified developer must have used REST APIs provided by others, or developed REST by himself. API. It should be pointed out that whether it is the client or the API provider, before development, a set of public API interfaces need to be defined and documented before coding. If the server and client are jointly developed, the server will usually first implement an API interface that can return a fixed string, and then slowly implement the API functions in future development.

Although some people may think that Docker has been abused here, and you can use files like sample.json to implement virtual APIs, there is an example below that can better solve the API problem when developing front-end and back-end separation.

To better explain what I mean, let me give you an example: JSON Server, a REST API for providing JSON data. Anyone who has used this container will know that since there is such an easy-to-use Docker JSON Server, we have no reason not to use Docker.

5. Technical innovation

This shouldn’t be considered a use case, but I’ll write it down anyway. Docker is developing rapidly and the tools are constantly being updated. No one can predict what Docker will look like in the future. The more you use Docker in complex systems, the more likely you are to discover gaps in technology and the direction of future technology development. We are still in the development stage of Docker, and any tool you create using Docker is likely to become a hot topic in the community. This is Docker’s opportunity, and it’s your own opportunity.

Recommended related tutorials: docker tutorial

The above is the detailed content of What does docker do?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn