about docker

Docker overview

Docker 是一个用于开发、发布和运行应用程序的开放平台。 Docker 使您能够将应用程序与基础架构分离,以便您可以快速交付软件。 使用 Docker,您可以像管理应用程序一样管理基础设施。 通过利用 Docker 快速交付、测试和部署代码的方法,您可以显著减少编写代码和在生产中运行之间的延迟。

The Docker platform

Docker 提供了在称为容器的松散隔离环境中打包和运行应用程序的能力。 隔离和安全性允许您在给定主机上同时运行多个容器。 容器是轻量级的,包含运行应用程序所需的一切,因此您无需依赖主机上当前安装的内容。 您可以在工作时轻松共享容器,并确保与您共享的每个人都获得以相同方式工作的同一个容器。

Docker 提供工具和平台来管理容器的生命周期:

  1. 使用容器开发您的应用程序及其支持组件。
  2. 容器成为分发和测试应用程序的单元。
  3. 准备就绪后,将应用程序部署到生产环境中,作为容器或编排的服务。 无论您的生产环境是本地数据中心、云提供商还是两者的混合,这都是一样的。

What can I use Docker for?

快速、一致地交付您的应用程序

Docker 通过允许开发人员使用提供应用程序和服务的本地容器在标准化环境中工作来简化开发生命周期。Containers are great for continuous integration and continuous delivery (CI/CD) workflows.

Responsive deployment and scaling

Docker 基于容器的平台允许高度可移植的工作负载。 Docker 容器可以在开发人员的本地笔记本电脑、数据中心的物理或虚拟机、云提供商或混合环境中运行。

Docker 的可移植性和轻量级特性还使得动态管理工作负载、根据业务需求近乎实时地扩展或拆除应用程序和服务变得容易。

Running more workloads on the same hardware

Docker 是轻量级和快速的。 它为基于管理程序的虚拟机提供了一种可行且经济高效的替代方案,因此您可以使用更多计算容量来实现业务目标。 Docker 非常适合高密度环境以及需要用更少资源完成更多工作的中小型部署。

Docker objects

When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects. This section is a brief overview of some of those objects.

Images

镜像是一个只读模板,其中包含创建 Docker 容器的说明。通常,一个镜像基于另一个镜像,并带有一些额外的自定义。For example, you may build an image which is based on the ubuntu image, but installs the Apache web server and your application, as well as the configuration details needed to make your application run.

You might create your own images or you might only use those created by others and published in a registry. To build your own image, you create a Dockerfile with a simple syntax for defining the steps needed to create the image and run it. Each instruction in a Dockerfile creates a layer in the image. When you change the Dockerfile and rebuild the image, only those layers which have changed are rebuilt. This is part of what makes images so lightweight, small, and fast, when compared to other virtualization technologies.

Containers

A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.

By default, a container is relatively well isolated from other containers and its host machine. You can control how isolated a container’s network, storage, or other underlying subsystems are from other containers or from the host machine.

A container is defined by its image as well as any configuration options you provide to it when you create or start it. When a container is removed, any changes to its state that are not stored in persistent storage disappear.


容器和镜像的关系——容器是镜像的可运行实例