search

Home  >  Q&A  >  body text

How to set Docker's Storage Driver to OverlayFS in CentOS7?

CentOS7 How to set docker's Storage Driver to OverlayFS?
What are the specific steps?

为情所困为情所困2738 days ago970

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-16 13:19:42

    ==First of all, you need to upgrade to CentOS7.2. An XFS bug has been fixed in the 7.2 system. ==

    docker 1.11

    Add OverlayFS to the module directory

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

    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 docker service

    rm -rf /var/lib/docker

    Modify docker configuration file

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

    Modify the configuration:
    Find the following line

    ExecStart=/usr/bin/dockerd 

    Add parameters:

    --storage-driver=overlay

    Restart

    systemctl daemon-reload
    systemctl restart docker

    reply
    0
  • Cancelreply