3 ms·
Also if you are running k8s, and use the same base image for your app containers, you amortize this cost as you only need to pull the base layers once per node.
by theptip 5y ago
Also if you are running k8s, and use the same base image for your app containers, you amortize this cost as you only need to pull the base layers once per node. So in practice you won’t pull that 100mb many times.
(This benefit compounds the more frequently you rebuild your app containers.)
- PaulKeeble 5y agoBase images like alpine/debian/ubuntu get used by a lot of third party containers too so if you have multiple containers running on the same device they may in practice be very small until the base image gets an upgrade.
- erik_seaberg 5y agoThis. The article talks about > Each layer in your image might have a leaner version that is sufficient for your needs. when reusing a huge layer is cheaper than choosing a small layer that is not reused.
- Ramiro 5y agoI think this something that people miss a lot when trying to optimize their Docker builds. Is the whole optimizing for most of your builds vs optimizing for a specific build. Not easy.
- yjftsjthsd-h 5y agoDoesn't that only work if you used the exact same base? If I build 2 images from debian:11 but one of them used debian:11 last month and one uses debian:11 today, I thought they end up not sharing a base layer because they're resolving debian:11 to different hashes and actually using the base image by exact image ID.
- gui77aume 5y agoIndeed. But the old debian and the new debian images may have a common layer.