Smaller Docker Images Using Multi-Stage Builds
codesalad.dev
codesalad.dev
If you opt-in to using the experimental BuildKit support that Docker has, you can also do some neat tricks like potentially skipping unused layers [1], as well as building layers in parallel based on their dependency hierarchy [2].
[0] https://github.com/jkachmar/alpine-haskell-stack/blob/master...