0
0
Dockerdevops~10 mins

Storage driver options in Docker - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Storage driver options
Docker daemon starts
Reads storage driver config
Select storage driver
Initialize driver
Manage container layers
Store container data
Containers run with storage
Docker daemon stops
Docker reads the configured storage driver when it starts, initializes it, and uses it to manage container file layers and data storage.
Execution Sample
Docker
docker info --format '{{.Driver}}'
docker run --rm alpine ls /
docker info --format '{{.DriverStatus}}'
Shows the current storage driver, runs a container, then shows detailed driver status.
Process Table
StepCommandActionOutput / Result
1docker info --format '{{.Driver}}'Check current storage driveroverlay2
2docker run --rm alpine ls /Run container and list root directorybin etc lib proc root sys tmp usr var
3docker info --format '{{.DriverStatus}}'Show detailed storage driver status["Backing Filesystem", "ext4"], ["Supports d_type", "true"], ["Native Overlay Diff", "true"]
💡 Commands complete showing storage driver in use and container filesystem accessed.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3
Storage Driverunknownoverlay2overlay2overlay2
Container Filesystemnonenonemounted and listedmounted and listed
Key Moments - 3 Insights
Why does Docker need to know the storage driver before running containers?
Docker uses the storage driver to manage how container files and layers are stored and accessed. Without it, containers cannot read or write files properly. See execution_table step 1 and 2.
What does the 'overlay2' driver mean in the output?
'overlay2' is a modern storage driver that uses overlay filesystem technology to efficiently manage container layers. It is shown in execution_table step 1 output.
Why do we run 'docker info --format '{{.DriverStatus}}'' after running a container?
This command shows detailed info about the storage driver capabilities and status, confirming it is working correctly with the container filesystem. See execution_table step 3.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table step 1, what storage driver is Docker using?
Aaufs
Boverlay2
Cdevicemapper
Dbtrfs
💡 Hint
Check the output column in execution_table step 1.
At which step do we see the container filesystem contents listed?
AStep 1
BStep 3
CStep 2
DNone
💡 Hint
Look for the 'ls /' command output in execution_table.
If Docker used 'aufs' instead of 'overlay2', which step output would change?
AStep 1 and Step 3
BStep 2 only
CStep 1 only
DAll steps
💡 Hint
Storage driver name appears in step 1 and detailed driver info in step 3.
Concept Snapshot
Docker Storage Driver Options:
- Docker selects a storage driver at daemon start.
- Storage driver manages container file layers.
- Common drivers: overlay2 (modern), aufs, devicemapper.
- Check current driver: docker info --format '{{.Driver}}'
- Detailed status: docker info --format '{{.DriverStatus}}'
- Driver affects container filesystem performance and features.
Full Transcript
When Docker starts, it reads the configured storage driver option. This driver controls how Docker stores and manages container files and layers. For example, the 'overlay2' driver uses overlay filesystem technology to efficiently handle container data. Running 'docker info --format '{{.Driver}}'' shows which driver is active. Running a container like 'docker run --rm alpine ls /' mounts the container filesystem using that driver. Finally, 'docker info --format '{{.DriverStatus}}'' shows detailed info about the driver's capabilities and status. Understanding storage drivers helps troubleshoot container storage and performance issues.