I was looking at storage section where i found that image layer and container layer . The image layer with the application is read only where the container layer is read/write . It also said that if you a new source code and application but the image layer consisting of base ubuntu ,apt-get update are the same ,it would re-use the first three layers in the image layer. How it is going to use when the image layer itself is read only ?
Docker images are composed of multiple read-only layers. Each layer represents a set of filesystem changes, such as adding or modifying files, and is immutable once created.
When a container is created from an image, Docker creates a new read-write layer on top of the existing image layers. This layer is where all changes made during the container’s runtime are stored, including file modifications, additions, and deletions.
So, the image layers are read-only and immutable, they serve as a foundation for containers. The container layer allows for modifications during runtime without altering the original image layers.
Hope this helps.