If you want to use Volume with Containers, please refer this url.
Volumes are often a better choice than persisting data in a container’s writable layer, because a volume does not increase the size of the containers using it, and the volume’s contents exist outside the lifecycle of a given container.
When its comes to a question of How to specify the size limit while creating the docker volume?
As we can see it’s possible to create docker volumes with a predefined size and do it from Docker API which is especially useful if you’re creating new volumes from some container with mounted docker socket and don’t have access to the host.
But Currently, Its looks like only tmpfs mounts support disk usage limitations.
It is possible to specify the size limit while creating the docker volume using size param with –opt options.
Good reference
https://medium.com/@dmitrytk/limit-docker-volume-size-9859682f4147
Docker Tutorials Fundamental To Advanced-2021 Crash Course:- https://bit.ly/3hOIbTB
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND