To run the same app everywhere, you need a fixed, shareable package of its files and settings. An image is that package, built from read-only layers that are shared between images and containers to save disk and download time. Understanding layers explains why an image is huge even after you delete files in a later step. Remember that anything written inside a running container is lost when it is removed, so keep data in volumes instead.