green-code-initiative / ecoCode-challenge

Emboard in the hackhatons serie for improving ecoCode
4 stars 5 forks source link

[Hackathon 2024][Gadolinium][Docker] Existing rules in Sonar : Cache should be cleaned after package installation #117

Open MP-Aubay opened 5 months ago

MP-Aubay commented 5 months ago

(This rule already exist in Sonarqube but is relevant to ecocode https://rules.sonarsource.com/docker/RSPEC-6587/)

Rule title

Cache should be cleaned after package installation

Language and platform

Docker

Rule description

See rule : https://rules.sonarsource.com/docker/RSPEC-6587/

Rule short description

When installing packages an index is cached locally by default. The index can be used on-the-fly and not stored locally.

Rule justification

Cleaning cache after package installation can reduce the size image and can reduce energy consumption.

Why it matters:

Official documentation : https://docs.docker.com/develop/develop-images/guidelines/

Severity / Remediation Cost

Severity : Major

Implementation principle

Already implemented.