Docker的底层实现所依赖的关键技术

The underlying technology

Docker is written in Go and makes use of several Linux kernel features to deliver the functionality we've seen.

Namespaces

Docker takes advantage of a technology called namespaces to provide the isolated workspace we call the container.  When you run a container, Docker creates a set of namespaces for that container.

This provides a layer of isolation: each aspect of a container runs in its own namespace and does not have access outside it.

Some of the namespaces that Docker uses are:

  • The pid namespace: Used for process isolation (PID: Process ID).

  • The net namespace: Used for managing network interfaces (NET: Networking).

  • The ipc namespace: Used for managing access to IPC resources (IPC: InterProcess Communication).

  • The mnt namespace: Used for managing mount-points (MNT: Mount).

  • The uts namespace: Used for isolating kernel and version identifiers. (UTS: Unix Timesharing System).

Control groups

Docker also makes use of another technology called cgroups or control groups. A key to running applications in isolation is to have them only use the resources you want. This ensures containers are good multi-tenant citizens on a host. Control groups allow Docker to share available hardware resources to containers and, if required, set up limits and constraints. For example, limiting the memory available to a specific container.

Union file systems

Union file systems, or UnionFS, are file systems that operate by creating layers, making them very lightweight and fast. Docker uses union file systems to provide the building blocks for containers. Docker can make use of several union file system variants including: AUFS, btrfs, vfs, and DeviceMapper.

Container format

Docker combines these components into a wrapper we call a container format. The default container format is called libcontainer. Docker also supports traditional Linux containers using LXC. In the future, Docker may support other container formats, for example, by integrating with BSD Jails or Solaris Zones.

内容来源:https://docs.docker.com/introduction/understanding-docker/

转载于:https://my.oschina.net/yapple/blog/295128

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Docker是一个开源的容器化平台,它使用了一种轻量级的虚拟化技术,可以将应用程序及其依赖项打包成一个独立的容器,提供了更高效、更可靠的应用部署和管理方式。 Docker的系统架构包含以下几个关键组件: 1. Docker守护进程(Docker daemon):Docker守护进程是Docker引擎的核心组件,负责管理镜像、容器和存储等资源。守护进程通过RESTful API与其他组件通信,并执行用户指定的命令。 2. Docker客户端(Docker client):Docker客户端是用户与Docker守护进程进行交互的接口。用户可以通过命令行工具或者Docker提供的API进行操作,例如创建、启动、停止和删除容器等。 3. Docker镜像(Docker image):Docker镜像是一个只读的模板,包含了运行应用程序所需的文件系统、环境变量和依赖项等。镜像可以由基础镜像构建而来,也可以通过Dockerfile定义构建步骤。 4. 容器(Container):容器是基于镜像创建的实例,它是运行应用程序的独立环境。Docker利用Linux内核的隔离技术,如命名空间和控制组,来实现容器与宿主机之间的资源隔离。每个容器都有自己的文件系统、网络和进程空间,可以独立运行和管理。 5. 注册中心(Registry):注册中心是存储和共享Docker镜像的服务器。Docker Hub是最常用的公共注册中心,用户可以从中获取各种官方和社区贡献的镜像。除了公共注册中心,用户还可以搭建自己的私有注册中心。 6. Docker网络(Docker networking):Docker提供了多种网络驱动程序,用于为容器提供网络连接。例如,桥接驱动程序可以创建一个本地网络,将容器连接到宿主机上的网桥设备,以实现容器之间的通信。 总之,Docker的系统架构基于容器化技术,通过守护进程、客户端、镜像、容器、注册中心和网络等组件配合工作,为用户提供了一种便捷、高效的应用部署和管理方式。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值