专注网站建设公司,网站类网站开发,网站受攻击,新氧整形网站开发模版Docker 1 什么是 Docker
Docker 是一种容器技术。只要开发者将其应用和依赖包进行打包#xff0c;放入到一个轻量级的、可移植的容器中#xff0c;就能发布到任何流行的 linux 机器上。
Docker 的要素#xff1a;
image 镜像#xff1a;静态的container 容器#xff1a…Docker 1 什么是 Docker
Docker 是一种容器技术。只要开发者将其应用和依赖包进行打包放入到一个轻量级的、可移植的容器中就能发布到任何流行的 linux 机器上。
Docker 的要素
image 镜像静态的container 容器动态的镜像相当于类容器相当于实例dockerfile 自动化脚本dockerfile 文件用于创建新的镜像
Docker 的特点
模拟完全相同的系统环境解决软件跨环境迁移的问题完全使用沙箱机制容器之间相互隔离容器性能开销极低比虚拟机更加轻量 Docker 本身并不是容器而是创建容器的工具是应用容器引擎。除了 Docker还有其它工具可以用于创建容器。 Docker 产品类型
CE 社区版EE 企业版 vscode 添加 docker 扩展。 2 Docker 的架构 Docker 采用的是 C/S 架构。
Docker 对象
镜像 images是一个特殊的、分层的文件系统 包含所需的程序、库、资源、配置文件、配置参数等不包含动态数据其内容在构建后不再改变 容器 containers实质是进程 docker run 起来以后会添加一个读写层镜像和容器的关系就是类和实例的关系 仓库 registry用于保存所有创建好的镜像 公用仓库 Public Registry 是 Docker Hub私有仓库 Private Registry 启动容器时Docker daemon 会首先从本地获取相关镜像。当本地镜像不存在时将从 Regitry 中下载该镜像并保存在本地。拉取镜像必须使用 HTTPS 协议。 3 Docker 的底层技术
3.1 namespace
Docker uses a technology called namespaces to provide the isolated workspace called the container. When you run a container, Docker creates a set of namespaces for that container.
These namespaces provide a layer of isolation. Each aspect of a container runs in a separate namespace and its access is limited to that namespace.
docker engine uses namespaces such as the following on Linux:
The pid namespace: Process isolation (PID: Process ID).The net namespace: Managing network interfaces (NET: Networking).The ipc namespace: Managing access to IPC resources (IPC: InterProcess Communication).The mnt namespace: Managing filesystem mount points (MNT: Mount).The uts namespace: Isolationg kernel and version identifiers (UTS: Unix Timesharing System). 进程 PID实现进程之间的隔离网络 NET管理网络接口进程间通信 IPC信号量、消息队列和共享内存挂载 MNT管理文件系统的挂载点Unix 分时系统 UTS隔离内核和版本标识 3.2 Control groups 3.3 联合文件系统