Member-only story
Docker images are constructed in layers, and Docker containers retain all data within their writable layer. However, this data is transient and is only accessible for the duration of the container’s lifespan. Once the container is deleted, this data is no longer retrievable, posing challenges for accessing it from other processes.
Docker provides two resources for containers to store data:
- Image layer and container layer managed by storage driver
- Data volume
Ideally, very little data is written to a container’s writable layer, and you use Docker volumes or Bind mounts to write data.
Docker Storage Driver
A Docker storage driver is a component responsible for managing how Docker containers manage and store their data. It controls how container filesystems are created, stored, and manipulated. Docker storage drivers abstract the underlying storage infrastructure, allowing Docker containers to run consistently across different environments without being tightly coupled to specific storage solutions.
Docker engine provides the following storage drivers on Linux:
- overlay2: overlay2 is the recommended storage driver for all currently supported Linux distributions, requiring no…