Current location - Health Preservation Learning Network - Slimming men and women - Docker's file is getting bigger and bigger How to understand it?
Docker's file is getting bigger and bigger How to understand it?
The image of docker and some data are in the /var/lib/docker directory, which occupies the system partition of Linux, namely /dev/vda 1 below. When there are multiple images, the space of /dev/vda 1 may not be enough, so we can mount Docker's data on a data disk, such as /dev/vdb directory. [root @ 10- 10-63- 106 docker]# df-lhtfilesystemtypesizeusedavauiuse % mounted on/dev/vda 1 xfs 20g 3.8g 1 6G20%/devtmpsfsdevtmpfs916m0916m0%/devtmpfstmpfs921m0928 $ (date+%y-%m-%d) (2) Stop docker and use rsync to/var/lib/. If rsync is not installed, please install it using yum-yintallrsync and stop docker. Servicedockerstop, create the directory to be mounted to the data partition, mkdir/data/docker uses rsync tool to synchronize, rsync-axes /var/lib/docker/. /data/docker/, which may take a long time, depending on the size of /var/lib/docker. (3) Modify the fstab and add the following lines in the fstab of this file. Mount the new location in the file/var/lib/docker/data/docker/var/lib/dockernonebind00, as follows: [root @10-10-63-106 docker] # cat/etc/fstab. createdbyanacondaonthujul 3 107:50: 1320 14 # # Accessiblefilesystems,byreference, aremaintainedunder '/dev/disk ' # seemanpagessfstab(5),findfs(8), Mount(8) and/orblkid (8) for more info #/dev/vda1/xferrors = remount-ro01/ swapfilenoneswasdf-lhtfilesystemtypesizeusedavailse % mounted on/dev/vda 1x fs 20g 13g 6.9g 65%/devtmpfsdevtmpfs 9 16m 0%/ devtmpfstmpfs 92 1m 092 1m 0%/dev/shmtmpfstmpfs 92 1m 89m 832m 65438