reference:官方文档


container VS virtual machine

  • 虚拟机是虚拟出一套硬件,然后在其上运行一个完整的OS。例如,使用KVM指定系统镜像,然后装系统,最终可以使用,在该系统上再运行所需的app。
  • 容器内的应用程序直接运行在宿主的内核上,容器内没有自己的内核,也没有对硬件进行虚拟,因此容器比起虚拟机更为轻便。

some concepts

container: 一个container就是在主机上运行的独立于其他进程的一个沙盒进程。

  • is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI.
  • can be run on local machines, virtual machines or deployed to the cloud.
  • is portable (can be run on any OS).
  • is isolated from other containers and runs its own software, binaries, and configurations.

image: 当运行container时,它使用一个独立的文件系统。此自定义文件系统由 container image 提供。由于image包含container的文件系统,因此它必须包含运行应用程序所需的所有内容,例如,所有依赖项、配置、脚本、二进制文件等。image还包含container的其他配置,例如环境变量、要运行的默认命令和其他metadata。

Docker生命周期

Docker生命周期.png

Docker Engine

Docker是C/S架构的。
Docker Engine.png

Last modification:December 2, 2022
如果觉得我的文章对你有用,请随意赞赏