Container storage
Containers are lightweight by design and, as we saw earlier, often even the basic tools such as ifconfig
and ping
might not be included in container images. That is because containers represent a minimal version of the OS environment where we only install an application we are going to containerize with its dependencies. You don’t usually need many packages or tools pre-installed inside container images except for those required for your application to run.
Containers also don’t keep the state by default, meaning that if you’ve placed some files inside the container filesystem while it was running and deleted the container after, all those files will be completely gone. Therefore, it is common to call containers stateless and the on-disk files in containers ephemeral.
That does not mean we cannot use containers for important data that we need to persist in case a container fails or an application exits.
Note
In case the application...