
正文
Docker storage drivers
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
因为Docker的镜像是分层的,包含只读层和可读写层,因此选择正确的Storage Driver对于容器的性能是非常重要的。
支持的Linux发行版本
目前推荐使用性能最好的Overlay2。RHEL或CentOS需要要求Linux Kernel在4.0或以上,或者使用3.10.0-514以上版本。

支持的文件系统

查看Docker目前使用的Storage Driver
[root@node01 ~]# docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 18.06.-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: systemd
修改Docker的Storage Driver
[root@node01 ~]# vim /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": ["https://fz5yth0r.mirror.aliyuncs.com"],
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": ""
}
}
~







![【电子书】[职业技术] 《Docker生产环境实践指南》[美][Joe Johnston][epub+mobi+azw3] 【电子书】[职业技术] 《Docker生产环境实践指南》[美][Joe Johnston][epub+mobi+azw3]](https://www.04ip.com/template/qe/style/noimg/14.jpg)