How do we create a new image from an existing image when we already know that a docker image is read-only?
We cannot change an already existing image directly. We first create a new container using the image, and then we make the required changes in the container. Thereafter, we transform the changes into a new layer. We then create a new image by stacking the new layer on top of the old image.