CentOS7 如何设置docker 的Storage Driver为OverlayFS?
具体操作步骤有哪些?
PHPz2017-05-16 13:19:42
==首先要升级到CentOS7.2,有一个XFS的Bug在7.2系统被修复了。==
echo "overlay" > /etc/modules-load.d/overlay.conf
# lsmod | grep over
overlay 42451 0
reboot
创建文件夹
mkdir -p /etc/systemd/system/docker.service.d
加入参数:
cat >/etc/systemd/system/docker.service.d/override.conf <<E
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://
E
重启
systemctl daemon-reload
systemctl restart docker
echo "overlay" > /etc/modules-load.d/overlay.conf
lsmod | grep over
reboot
rm -rf /var/lib/docker
vi /usr/lib/systemd/system/docker.service
修改配置:
找到如下一行
ExecStart=/usr/bin/dockerd
加入参数:
--storage-driver=overlay
重启
systemctl daemon-reload
systemctl restart docker