Storage and Volumes (10%) Flashcards
Storage and Volumes (10%)
What is the pluggable architecture that Docker supports for the container writable layer storage?
Storage Drivers
What is the preferred storage driver for all Linux distributions which need no extra configuration?
Overlay2
Which device-mapper driver is used for production environments?
direct-lvm
Which device-mapper driver is used for testing environments?
loopback-lvm
How do you check the current storage driver information?
docker info
How do you configure device-mapper?
// stop dockersudo systemctl stop docker
// set the device-mapper in /etc/docker/daemon.json file { "storage-driver": "devicemapper"}
//start dockersudo systemctl start docker
What is the option that sets the direct-lvm for production device-mapper?
dm.directlvm_device
What do you set the device-mapper and all configurable options in the daemon.json?
{ "storage-driver": "devicemapper", "storage-opts": [ "dm.directlvm_device=/dev/xdf", "dm.thinp_percent=95", "dm.thinp_metapercent=1", "dm.thinp_autoextend_threshold=80", "dm.thinp_autoextend_percent=20", "dm.directlvm_device_force=false" ] }
What are the different available storage options available for containers?
Block Storage
File System Storage
Object Storage
Do containers create a writable layer on top of Image read-only layers?
Yes
Where is the Docker’s local storage area?
/var/lib/docker/
What is the difference between bind mounts and volumes?
Volumes are completely managed by docker
Bind Mounts are dependent on the host directory structure
Volumes don’t increase the size of the containers. Is this statement correct and why?
Yes. Because volumes live outside of containers
What should we use if we want to persist the data beyond the lifecycle of the containers?
Volumes
How to create a Volume?
docker volume create my-volume