2 ms·
Cramming things into one layer can save gigabytes in size. Even if it saves a 100MB, it adds up between multiple CI runs and in deployment latencies. Docker sh
by viraptor 3y ago
Cramming things into one layer can save gigabytes in size. Even if it saves a 100MB, it adds up between multiple CI runs and in deployment latencies.
Docker should address it one day, but until then, we just have to do it in real world scenarios.
- a_t48 3y agoParent comment agrees with you, is just asking for more ergonomic syntax
- viraptor 3y agoI get it, just providing more context. Should've phrased it nicer.
- yjftsjthsd-h 3y agoAn alternative solution... for some definition of the term... is to write a "naive" Dockerfile like RUN foo RUN bar RUN baz and then just build it with something like... I think kaniko did this last I looked?... that smashes the whole thing into a single layer. Obviously that has other tradeoffs (no reuse of layers) but depending on your usecase it can be a good trade to make (why yes, I did cut my teeth in an environment where very few images shared a base layer, why do you ask?).