PhilipMay / smart-prom-next

S.M.A.R.T. Prometheus Metrics Exporter
MIT License
17 stars 1 forks source link

reduce Alpine image size #45

Closed PhilipMay closed 2 years ago

PhilipMay commented 2 years ago

@ngosang sais:

it's possible to reduce Docker' images size to half. (if you do some changes in the Dockerfiles to avoid caching files and reduce the number of layers)

You can open another issue for that.

So - this is the issue - can yo provide some hints @ngosang ?

ngosang commented 2 years ago

Hint => https://github.com/matusnovak/prometheus-smartctl/pull/31/files

You can use this tool to inspect the layers => https://github.com/wagoodman/dive

ngosang commented 2 years ago

Image name: ghcr.io/philipmay/smart-prom-next:0.0.4rc1-alpine Total Image size: 71 MB Potential wasted space: 14 MB Image efficiency score: 89 %

Image name: matusnovak/prometheus-smartctl:v2.0.0 Total Image size: 52 MB Potential wasted space: 735 kB Image efficiency score: 99 %

PhilipMay commented 2 years ago

done with Alpine - what else can be done with Alpine and / or Debian?

ngosang commented 2 years ago

Sorry, I don't have time to explain. You can reduce both Docker images even more as enhancement. You can close if you want.

PhilipMay commented 2 years ago

https://www.fromlatest.io/

PhilipMay commented 2 years ago

https://www.augmentedmind.de/2022/02/06/optimize-docker-image-size/

PhilipMay commented 2 years ago
alpine defult
70.7

rm -rf /root/.cache/
kein effekt

rm -rf /var/cache/apk/*
68.2MB
PhilipMay commented 2 years ago

done