DEV Community

Discussion on: Docker: What it is and How to Use it With Python

Collapse
 
ikemkrueger profile image
Ikem Krueger

What is the difference between an image and a volume? When to use what?

Collapse
 
djangostars profile image
Django Stars

Image keeps all necessary binaries and libraries to be able to run required application, it could be described in Dockerfile. When you start new container it’s created from this image. To effectively utilize hardware resources data in containers should be immutable. In other words containers shouldn’t keep data produced by application you run inside container. And volume is directory mounted to container which keeps mutable data. You can think of it as a shared folder in virtual machine