DOCKER Use the Device Mapper storage driver

Device Mapper is a kernel-based framework that underpins many advanced volume management technologies on Linux. Docker’s devicemapper storage driver leverages the thin provisioning and snapshot capabilities of this framework for image and container management. This article refers to the Device Mapper storage driver as devicemapper, and the kernel framework as Device Mapper.
For the systems where it is supported, devicemapper support is included in the Linux kernel. However, specific configuration is required to use it with Docker. For instance, on a stock installation of RHEL or CentOS, Docker defaults to overlay, which is not a supported configuration.

 

[root@debasiseric1 ~]# docker info|grep storage

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `–storage-opt dm.thinpooldev` to specify a custom block storage device.

[root@debasiseric1 docker]# vi daemon.json

Please make entry:-

{
“storage-driver”: “devicemapper”
}

[root@debasiseric1 docker]# systemctl stop docker
[root@debasiseric1 docker]# systemctl start docker

[root@debasiseric1 docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE

[root@debasiseric1 docker]# docker info|grep storage

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `–storage-opt dm.thinpooldev` to specify a custom block storage device.

[root@debasiseric1 docker]# cd /var/lib/docker
[root@debasiseric1 docker]# cd devicemapper

[root@debasiseric1 devicemapper]# docker pull centos:6

6: Pulling from library/centos
987d765a926d: Pull complete
Digest: sha256:dcc6497b479d5380e92587c0ac2f861acc4f07ff29e01a3de283c14d2c655e2c
Status: Downloaded newer image for centos:6

[root@debasiseric1 devicemapper]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 2 days ago 195MB

[root@debasiseric1 devicemapper]# ls -ltr
total 0
drwx—— 2 root root 32 Apr 7 07:33 devicemapper
drwx—— 2 root root 140 Apr 9 12:44 metadata
drwxr-xr-x 2 root root 6 Apr 9 12:44 mnt

[root@debasiseric1 devicemapper]# docker info|grep Storage
WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `–storage-opt dm.thinpooldev` to specify a custom block storage device.
Storage Driver: devicemapper

 

Leave a Reply

Your email address will not be published. Required fields are marked *