CrunchyData / crunchy-containers

Containers for Managing PostgreSQL on Kubernetes by Crunchy Data
https://www.crunchydata.com/
Apache License 2.0
1.01k stars 328 forks source link

potential space savings in container images #1396

Open jansmets opened 2 years ago

jansmets commented 2 years ago

I was poking a little bit around examining the container images

There is some image space to be recovered.

crunchy-pgbackrest:centos8-2.35-0 and crunchy-pgbouncer:centos8-1.15-3

0       039b8fa9e2e0d59e6b59b7ff051957259c2e765eeec90f751bf3910b61b52275/var/cache/dnf
59M     4d11a92edf5fb39a2a49982510fd8a92ea596668b9216f69ff283b1ca672b0e0/var/cache/dnf
8.0K    7f6caad864889f519dc3717be7e1eda74b2c1c296a0212fb88b338cd7bf4522f/var/cache/dnf
28K     da53e6c8e018ad4983b3e167f71b49ba0bae03780feeda0b4fe772b0c4c9ae9c/var/cache/dnf
11M     039b8fa9e2e0d59e6b59b7ff051957259c2e765eeec90f751bf3910b61b52275/var/lib/rpm
1.7M    4d11a92edf5fb39a2a49982510fd8a92ea596668b9216f69ff283b1ca672b0e0/var/lib/rpm
17M     7f6caad864889f519dc3717be7e1eda74b2c1c296a0212fb88b338cd7bf4522f/var/lib/rpm
17M     da53e6c8e018ad4983b3e167f71b49ba0bae03780feeda0b4fe772b0c4c9ae9c/var/lib/rpm
15M     efca8def04926359751e50f337a47939ac8e7964a0bb6d138b67e86d9fb3b3bc/var/lib/rpm
119M    total

Similar for crunchy-postgres:centos8-14.0-0

jkatz commented 2 years ago

Hm...we're running dnf clean etc. pretty much after each install command, unless we missed some. Something worth looking into.

jkatz commented 2 years ago

@jansmets How did you introspect this?

jansmets commented 2 years ago

You can use docker export (or was it save, i always mix these up) to save the image, with all it's layers, to a tar file. If you then extract the tar it will give you subdirectories for each image layer.