These commands slightly increase the image size, instead of reducing it, since a new layer is created.
It would be better to execute these commands together with the one that install the software.
Be also aware that the debian:bullseye-slim image contain the following file: /etc/apt/apt.conf.d/docker-clean. No archives are kept by default.
I appreciate the improvement, though my preference is to add these changes incrementally since there are quite a lot of them, with potential breaking ones (see my PR comments in #645).
https://github.com/sosedoff/pgweb/blob/41bf189e6b00f43b8a8d201ac7cef1f1368af47e/Dockerfile#L27-L30
These commands slightly increase the image size, instead of reducing it, since a new layer is created. It would be better to execute these commands together with the one that install the software.
Be also aware that the
debian:bullseye-slim
image contain the following file:/etc/apt/apt.conf.d/docker-clean
. No archives are kept by default.