To tie up everything you've learned so far about containers, images, and layers, let’s take a look at what happens when we run a container.
When running a container, a new writable container layer is created on top of the read-only image (which is composed of read-only layers):

Any file changes are contained within the container layer. This means that when we are done with a container, we can simply exit the container (remove the writable container layer), and all changes will be discarded.
We won’t go into too much detail here, but you can persist files from a container by writing to a mounted volume, and you can keep the changes in your current container by creating a new image based on those changes using docker commit.
Because a container is simply an isolated, writable layer on top of a stateless, read-only image, you can have multiple containers sharing access to the same image.
