系统相关
首页 > 系统相关> > Centos7 修改docker文件系统引擎为overlayfs

Centos7 修改docker文件系统引擎为overlayfs

作者:互联网

查看默认docker文件系统引擎信息

[root@client ~]# docker info
Containers: 19
 Running: 16
 Paused: 0
 Stopped: 3
Images: 18
Server Version: 1.12.6
Storage Driver: devicemapper #默认为devicemapper

停止docker服务

[root@docker ~]# service docker stop
Redirecting to /bin/systemctl stop docker.service

将OverlayFS加到module目录下

echo "overlay" > /etc/modules-load.d/overlay.conf

reboot系统

确认overlay生效

[root@docker ~]# lsmod |grep over
overlay                37831  0 

配置Docker Daemon用OverlayFS启动

[root@docker ~]# vi /etc/systemd/system/docker.service.d/override.conf 
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon --storage-driver=overlay

启动Docker daemon

[root@docker ~]# systemctl daemon-reload
[root@docker ~]# service docker start   
Redirecting to /bin/systemctl start docker.service

查看修改后的文件系统引擎信息

[root@docker ~]# docker info |grep overlay
Storage Driver: overlay

标签:bin,service,overlay,overlayfs,Centos7,systemctl,docker,root
来源: https://blog.51cto.com/9103824/2387916