因为Docker的镜像是分层的,包含只读层和读写层,因此选择正确的Storage Driver对于容器的性能是非常重要的。
Docker针对不同的操作系统支持不同的Storage Driver,目前都推荐使用性能最好的overlay2。
查看Docker目前使用的Storage Driver
[root@node01 ~]# docker info Containers: 25 Running: 21 Paused: 0 Stopped: 4 Images: 19 Server Version: 18.06.3-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": "3" } } ~
原文:https://www.cnblogs.com/vincenshen/p/10749398.html