Storage and Volumes (10%) Flashcards

Storage and Volumes (10%)

1
Q

What is the pluggable architecture that Docker supports for the container writable layer storage?

A

Storage Drivers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the preferred storage driver for all Linux distributions which need no extra configuration?

A

Overlay2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which device-mapper driver is used for production environments?

A

direct-lvm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which device-mapper driver is used for testing environments?

A

loopback-lvm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you check the current storage driver information?

A

docker info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you configure device-mapper?

A
// stop 
dockersudo systemctl stop docker
// set the device-mapper in /etc/docker/daemon.json file
{  "storage-driver": "devicemapper"}
//start 
dockersudo systemctl start docker
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the option that sets the direct-lvm for production device-mapper?

A

dm.directlvm_device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What do you set the device-mapper and all configurable options in the daemon.json?

A
{
  "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"
  ]
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the different available storage options available for containers?

A

Block Storage
File System Storage
Object Storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Do containers create a writable layer on top of Image read-only layers?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Where is the Docker’s local storage area?

A

/var/lib/docker/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between bind mounts and volumes?

A

Volumes are completely managed by docker

Bind Mounts are dependent on the host directory structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Volumes don’t increase the size of the containers. Is this statement correct and why?

A

Yes. Because volumes live outside of containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What should we use if we want to persist the data beyond the lifecycle of the containers?

A

Volumes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to create a Volume?

A

docker volume create my-volume

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to list docker volumes?

A

docker volume ls

17
Q

How to inspect docker volume?

A

docker volume inspect my-vol

18
Q

How to remove docker volumes?

A

docker volume rm my-vol

19
Q

If you start a container with a volume that does not yet exist, Docker creates the volume for you. Is this statement correct?

A

Yes

20
Q

How to create a volume myvol2 with a docker run?

A

docker run -d \

  • -name devtest \
  • v myvol2:/app \
    nginx: latest
21
Q

How to verify the volume is created with the container?

A

// Look for the mounts sectiondocker inspect devtest

22
Q

How to create a volume with the –mount flag?

A

docker run -d \

  • -name devtest \
  • -mount source=myvol2,target=/app \
    nginx: latest
23
Q

How to remove all unused images not just dangling images?

A

docker system prune –all