Skip to content

Instantly share code, notes, and snippets.

@1duo
Last active October 4, 2018 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1duo/dd49e75b9c0521896a64c65b9649541f to your computer and use it in GitHub Desktop.
Save 1duo/dd49e75b9c0521896a64c65b9649541f to your computer and use it in GitHub Desktop.
Some notes for docker in docker.

Docker in docker implementation:

https://github.com/jpetazzo/dind

Issue:

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.

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment