Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 550 Bytes

DL3042.md

File metadata and controls

23 lines (14 loc) · 550 Bytes

Pattern: Use of cache directory with pip

Issue: -

Description

Once a package is installed, it does not need to be re-installed and the Docker cache can be leveraged instead. Since the pip cache makes the images larger and is not needed, it's better to disable it.

Example of incorrect code:

RUN pip3 install MySQL_python

Example of correct code:

RUN pip3 install --no-cache-dir MySQL_python

Further Reading