Containers and Non-Persistent Data
Let’s take a look at containers and their associated non-persistent data.
We'll cover the following
Containers are designed to be immutable. This is just a buzzword that means read-only — it’s a best practice not to change the configuration of a container after it’s deployed. If something breaks or you need to change something, you should create a new container with the fixes/updates and deploy it in place of the old container. You shouldn’t log into a running container and make configuration changes!
The need for read-write filesystems
However, many applications require a read-write filesystem in order to simply run — they won’t even run on a read-only filesystem. This means it’s not as simple as making containers entirely read-only. Every Docker container is created by adding a thin read-write layer on top of the read-only image it’s based on. The figure below shows two running containers sharing a single read-only image.
Get hands-on with 1200+ tech skills courses.