Docker storage drivers and storage models
Storage drivers allows you to create data in the writable layer of the container, the files written in this layer do not persist when the…
Storage drivers allows you to create data in the writable layer of the container, the files written in this layer do not persist when the container is is deleted and read / write speed is lower than the host read / write speed.
A docker image is layers and each layer is an instruction in a docker file, every layer is read only.
FROM ubuntu:20.04 <--- layer 1
COPY . /application <--- layer 2
CMD python /application/app.py <--- layer 3When we start a container using an image all new data or modification of existing data is written to a new layer, this layer is deleted when the container is deleted but the image used to create the container remains untouchable.
By default the current preferred storage driver by new docker versions and new linux distributions is overlay2 (docker greater than 18.02 and current linux versions)/ aufs was the default storage driver for ubuntu 14.04 and older. overlay2 and aufs are memory efficient, not good for write operations.
devicemapper was the default for Centos 7. devicemapper stores data in form of blocks good for heavy write operations.