官术网_书友最值得收藏!

Docker containers

A container is an instance of an application created from an image. The image contains the whole application stack, and it also specifies the process to start the application, so Docker knows what to do when you run a container. You can run multiple containers from the same image, and you can run containers in different ways. (I'll describe them all in the next chapter.)

You start your application with docker container run, specifying the name of the image and your configuration options. Distribution is built into the Docker platform, so if you don't have a copy of the image on the host where you're trying to run the container, Docker will pull the image first. Then it starts the specified process, and your app is running in a container.

Containers don't need a fixed allocation of CPU or memory, and the processes for your application can use as much of the host's compute power as they need. You can run dozens of containers on modest hardware, and unless the applications all try to use a lot of CPU at the same time, they will happily run concurrently. You can also start containers with resource limits to restrict how much CPU and memory they have access to.

Docker provides the container runtime, as well as image packaging and distribution. In a small environment and in development, you will manage individual containers on a single Docker host, which could be your laptop or a test server. When you move to production, you'll need high availability and the option to scale, and that comes with an orchestrator like  Docker Swarm.

主站蜘蛛池模板: 通城县| 霍山县| 连江县| 大宁县| 页游| 铁力市| 芜湖县| 江孜县| 都昌县| 象州县| 台安县| 衡南县| 景宁| 沅陵县| 吴桥县| 周宁县| 班戈县| 阿合奇县| 曲麻莱县| 澜沧| 崇信县| 八宿县| 申扎县| 清水县| 大冶市| 樟树市| 肃北| 绥阳县| 盈江县| 辽阳县| 平果县| 迁安市| 青川县| 鄯善县| 治多县| 武强县| 洛宁县| 疏勒县| 太仆寺旗| 丽水市| 郧西县|