Centos 7: 改变docker的image存放目录

steps:

1. mkdir /home/docker(你想要docker存放image的目录)

2. systemctl stop docker

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

4. 添加 -g /home/docker

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket

[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -g /home/docker -H fd://
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target

5. cp -R /var/lib/docker/* /home/docker/

6. systemctl daemon-reload

7. systemctl start docker

 

done.

posted @ 2016-06-21 15:13  GreatK  阅读(6514)  评论(0编辑  收藏  举报