docker-nginx-http2 icon indicating copy to clipboard operation
docker-nginx-http2 copied to clipboard

Purging apt in a separate layer only bloats the image

Open ghostsquad opened this issue 8 years ago • 1 comments

https://github.com/Ehekatl/docker-nginx-http2/blob/master/Dockerfile#L45

Purging apt in a separate layer only bloats the image instead of reducing size, as the previous layer is saved in its entirety, and then the next layer has to apply the diff, which is to remove files.

ghostsquad avatar Dec 21 '17 18:12 ghostsquad

In addition you'll want to merge that layer with the apt-get layer so that you get build dependencies and clean them up in the same layer.

ghostsquad avatar Dec 21 '17 18:12 ghostsquad