↓ Skip to main content

“Well, I have been doing it wrong all these years.”

Vamsiblog.vamc19.dev ↗

Copy an 80MB binary into an image, then chmod it in a later RUN step, and OverlayFS copies the whole file into a new layer just to flip a permission bit. The image went from 267MB to 174MB by setting the mode at copy time. He had written that pattern into Dockerfiles for years without noticing. So have a lot of people, and their registry bills show it.