![](https://sandeeppote.com/wp-content/uploads/2022/01/image-38.png)
Docker uses storage drivers to store the read-only images and writable containers
It basically has 6 layers
Read-only/Image Layers
- Base Image e.g. Ubuntu OS
- Packages/Repositories e.g. apt etc
- Dependencies e.g. pip etc
- Custom Code e.g. python code etc
- Enrtypoint or command i.e. excutes the program
Writable Layer
6. Container Layer
![Layers of a container based on the Ubuntu image](https://sandeeppote.com/wp-content/uploads/2022/01/container-layers.jpg)
Data and files related to images and containers are store in /var/lib/docker folder in Ubuntu
![](https://sandeeppote.com/wp-content/uploads/2022/01/image-33.png)
To check the storage driver used by the docker, use following command-
docker info | more
Im my case it is overlay2
![](https://sandeeppote.com/wp-content/uploads/2022/01/image-34.png)
You can also use this command to get the storage driver
docker info | grep "Storage Driver"
![](https://sandeeppote.com/wp-content/uploads/2022/01/image-35.png)
How to change the storage driver
Stop the Docker service
systemctl stop docker.socket
systemctl stop docker
Check the docker service status
service docker status
Backup the docker folder
cp -au /var/lib/dovker /var/lib/docker.bk
Change the storage driver
echo '{ "storage-driver": "aufs" }' | sudo tee /etc/docker/dameon.json
service docker start
Image credit and reference links –
https://docs.docker.com/storage/storagedriver/
https://docs.docker.com/storage/storagedriver/overlayfs-driver/