After reading Baidu Encyclopedia for a while, I still didn’t really understand it because there were too many professional terms. Who can simply explain, for example, what problem does it solve?
I have just read the answers from several great gods. Perhaps I have had too little contact with them. The feeling is still not very clear. Is it equivalent to a virtual machine, to which virtual machine do you deploy the software? Isn’t the performance much worse? If it uses the resources of the host machine, then it is no different from running directly on the host machine. If the host machine lacks its dependency library, it still cannot run.
For example, you are using
UbuntuThe server uses
CentOS, then at this time you have to deploy the project to the server, which may take a lot of time to configure the environment. Or, for example, what you use
MySQLIn the past, every time you reinstall the system or change the environment, you have to reinstall your environment. The more things you have, the more time you spend.
DockerAll you need is an order, and you can use it in your
UbuntuRun a “new environment” in the world. of course, this environment is still based on your existing environment, that is to say, you actually share the same set of resources, but this environment already has what you need.
MySQL, then install a belt
MySQL, and then start a container.
Redis, then install a belt
Redis, and then start a container.
You need to … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then … then …
Of course, you can also modify the container on the basis of others, such as adding some of your own software or modifying the configuration file, and then
commitIn this way, you can make this container into a mirror image, and later you can use this mirror image to create n identical containers.
For example, you have to learn to pick up
RedisCluster, then you can download one
RedisAfter the configuration of the cluster is set up, submit the container to generate a mirror image, and then run 6 or more containers according to the mirror image, thus forming a cluster.
DockerThe occupied resources are very small.