pip install --no-cache-dir <package>
5COPY requirements.txt auto_summary
6
7# installing dependencies
8RUN pip install --no-cache -r auto_summary/requirements.txt 9SHELL ["/bin/bash", "--login" , "-c"]
10
11# setting work directory
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.
RUN pip3 install foobar
RUN pip3 install --no-cache-dir foobar