How does CentOS7 set docker’s Storage Driver to OverlayFS?

  docker, question

How does CentOS7 set docker’s Storage Driver to OverlayFS?
What are the specific operation steps?

= = First upgrade to CentOS7.2. One XFS Bug was fixed in 7.2. ==

docker 1.11

Add OverlayFS to the module directory

echo "overlay" > /etc/modules-load.d/overlay.conf
 
 # lsmod | grep over
 overlay                42451  0
 reboot

To configure Docker Daemon to start with OverlayFS:

Create folder

mkdir -p /etc/systemd/system/docker.service.d

Add parameters:

cat >/etc/systemd/system/docker.service.d/override.conf <<E
 [Service]
 ExecStart=
 ExecStart=/usr/bin/docker daemon --storage-driver=overlay -H fd://
 E

Restart

systemctl daemon-reload
 systemctl restart docker

docker 1.12

Add OverlayFS to the module directory

echo "overlay" > /etc/modules-load.d/overlay.conf
 lsmod | grep over
 reboot

Stop the docker service

rm -rf /var/lib/docker

Modify docker’s Configuration File

vi /usr/lib/systemd/system/docker.service

Modify configuration:
Find the following line

ExecStart=/usr/bin/dockerd

Add parameters:

--storage-driver=overlay

Restart

systemctl daemon-reload
 systemctl restart docker