Use your own custom images for image size optimisation
File: build/building/multi-stage.md For multi-stage builds to be efficient you need to know what is inside your docker images including the official docker images. The advantages of using multi-stage builds relies on docker's layering and if the images being layered themselves contain unused packages that advantage is wasted. This point may be obvious to experts but no where is this emphasised. There are also issues with these claims:
-
"Multi-stage builds are useful to anyone who has struggled to optimize Dockerfiles while keeping them easy to read and maintain."
-
"Multi-stage builds allow you to drastically reduce the size of your final image, without struggling to reduce the number of intermediate layers and files"
I wrote this to explain why these claims don't stand up to scrutiny
In short , Multi-stage builds does not allow you to drastically reduce the size of your final image rather the sizes of the images you choose for your stages allows you that. Image size optimisation is reducing the size of the image itself not choosing another image.