Libcontainer
前身LXC(docker 1.8废弃)
-
一种内核虚拟化技术
-
提供轻量级的虚拟化
-
并与隔离进程与资源
缺点:
- 无法有效支持跨主机直接的容器迁移、管理复杂
Docker
- 底层使用了lxc来实现
- 在lxc的基础上。docker提供一系列更强的功能
Docker核心技术
-
Namespace : 提供一种内核级别环境隔离的方法(6大名称空间)
- pid:进程
- ipc:信号量、消息队列
- 挂载点
- network
- user:用户和组
- 主机名与域名
-
cgroup: 内核附加在程序上的一系列钩子,程序运行时对资源的调度触发相应的钩子达到资源追踪和限制
- 功能
- 资源限制
- 优先级分配
- 资源统计
- 任务控制
- 功能
-
chroot: 实现文件隔离
-
UnionFS: GraphDriver分为
- Overlay2 (docker1.12默认)
- Overlay
- Aufs
- Devicemapper
- Btrfs
- Zfs
- Vfs
4大网络模型
- host
- 共享主机网络
- 没有独立ip
- none
- 有自己的网络栈、但不进行任何配置
- bridge
- 独立网络
- container
- 与存在的容器共享网络