https://github.com/jpetazzo/dind
docker pull consume tremendous amount of storage until no space left on device.
Check backing file system host docker is using with command docker info:
$ docker info
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
On file system with support d_type: false, docker in docker (check docker info inside docker container) uses Storage Driver: vfs.
If host file system is XFS, we need d_type = true to ensure docker works fine using overlay file system. If not, we can either reformat host file system to support d_type = true, or simply change host docker storage location (default is /var/lib/docker). Be aware this will cause previously pulled docker images disappear.
To do so, on CentOS, we need to:
sudo systemctl stop docker
ln -s <directory> /var/lib/docker
sudo systemctl start docker
The directory has to be on a file system that is XFS with d_type support. Or other file system such as ext4. Use command df -Th to see disks available.