Install docker and change data directory

Docker is a useful container but by default all docker’s stuff will place in /var/lib/docker in many case this will share with root disk space. For easy to maintain disk space we just change docker’s directory to separate disk or path.

Install docker

wget https://get.docker.com -O- | bash -

Edit /etc/docker/daemon.json

{
...
"graph":"/path/to/target"
...
}

Stop dockerd

service docker stop

Move old docker data

rsync -aP /var/lib/docker/* /path/to/target/

Start dockerd

service docker start

 

โซเชียล

Kawin Viriyaprasopsook

System administrator at Zercle Technology Co., Ltd.
System admin กากๆ
รักในการเล่นเกม
ชอบดู Anime ญี่ปุ่น
โซเชียล

Leave a Reply