An image cache is Docker Engine’s local storage for image layers. Built and downloaded images remain available for reuse by other images and containers. section 3.3
The cache makes image reuse practical:
- Docker reports each image’s logical size, but shared layers consume disk space only once. section 3.4
- Shared image layers are read-only, preventing changes in one image from affecting other images that reuse them. section 3.4
- Reusing common runtime layers can reduce disk usage and support smaller, faster image builds. section 3.4
Inspect and use a locally cached image
Build an image with `docker image build --tag web-ping .`, then list it with `docker image ls 'w*'`. The resulting `web-ping` image is stored in the local cache and can run with `docker container run -e TARGET=docker.com -e INTERVAL=5000 web-ping`. Use `docker system df` to inspect actual Docker disk usage rather than relying only on logical image sizes. section 3.3 section 3.4
docker system df
Inspect Docker’s actual disk usage, including space saved by shared image layers. section 3.4
