(一)Docker 的直观了解和架构

直通车

docker 官方镜像&适配&compose

Docker 镜像加速

Docker Compose

Docker 能做什么?

Docker 是容器,这个容器很强大,可以作为操作系统来使用,比如在里面部署jdk,tomcat,nginx等。这些安装在 Docker 里的软件有一个统一的名称——Docker 容器,他们来自于 Docker 镜像。但是需要强调的是,对比虚拟机而言,Docker 容器本身是独立的,比如你有一个 tomcat 的容器,其本身就已经包含了 jdk 的部署,即容器本身就是一个可以运行的“完整系统“,但是容器的体积小,启动速度都是秒级别的。

Docker 的由来——借助操作系统隔离技术

https://zhuanlan.zhihu.com/p/82833250

直观的来说,我们需要明白几个概念。

  • Docker 引擎管理 Docker 的地方,比如 Docker 镜像、容器和其他配置文件。
  • Docker 客户端是我们操作 Docker 命令的地方。
  • Docker ImagesDocker 镜像 是操作系统中各种软件的"安装包",比如 nginx、mysql、tomcat,注意是安装包 ,但是这个安装包内容不一定是初始化的,如果你有安装过操作系统的经历就很容易理解这一点,比如纯净版操作系统镜像,安装好了各种软件的操作系统镜像。是的,Docker 镜像是可以自定义的。
  • Docker Registry是存储 Docker 镜像的地方,这个位置默认是 Docker Hub ,即官方的,你也可以自己建一个,可以联想一个git hub和开源中国。
  • Docker ContainerDocker 容器是安装好配置好的软件,即 镜像可以被用来产生具体的容器,比如一个 nginx 镜像可以用来生成一个 容器,你可以配置端口号等等。当然,这个镜像可以用于产生多个容器。
  • Docker daemonDocker 引擎用于处理整个 Docker 业务的一个后台驻留程序 。

Docker 的官方介绍

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

Container images become containers at runtime and in the case of Docker containers - images become containers when they run on Docker Engine. Available for both Linux and Windows-based applications, containerized software will always run the same, regardless of the infrastructure. Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.

Docker containers that run on Docker Engine:

  • Standard: Docker created the industry standard for containers, so they could be portable anywhere
  • Lightweight: Containers share the machine’s OS system kernel and therefore do not require an OS per application, driving higher server efficiencies and reducing server and licensing costs
  • Secure: Applications are safer in containers and Docker provides the strongest default isolation capabilities in the industry

Docker 的架构

Docker 官方文档架构图
Docker 官方文档架构图
在这里插入图片描述

  • Docker daemon ( Docker 守护进程 )
    Docker daemon 是一个运行在宿主主机(DOCKER_HOST)的后台进程。可通过客户端与之通信。
  • Client ( Docker 客户端 )
    Docker 客户端是 Docker 的用户界面,它可以接受用户命令和配置标识,并与 Docker daemon 通信。
  • Images (Docker 镜像)
    Docker 镜像是一个只读模板,它包含创建 Docker 容器的说明。
  • Container ( 容器 )
    容器是镜像的可运行实例。镜像合并容器的关系有点类似于面向对象中,类和对象的关系。可通过 Docker API 或者 CLI 命令来启动、移动、删除容器。
  • Registry
    Docker Registry 是一个集中存储与分发镜像的服务。构建完 Docker 镜像后,就可以在当前宿主机上运行。但是如果想在其他机器上运行这个镜像,就要手动复制。而 Docker Registry 可以用于替代手动替换。
    一个 Docker Registry 可包含多个 Docker 仓库,每个仓库可包含多个镜像标签,每个标签对应一个Docker 镜像。
    Docker Registry 可分为公有 Docker Registry 和私有 Docker Registry。最常用的 Docker Registry 莫过于官方的 Docker Hub,这也是默认的 Docker Registry。

Docker 官方命令行

https://docs.docker.com/engine/reference/commandline/cli/

参考

[1]、https://www.docker.com/resources/what-container
[2]、https://www.kubernetes.org.cn/tags/cncf

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值