Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit babd9c8

Browse files
authored
use --no-cache-dir flag to pip in dockerfiles to save space (#1189)
using "--no-cache-dir" flag in pip install ,make sure downloaded packages by pip don't cached on system . This is a best practice which make sure to fetch from repo instead of using local cached one . Further , in case of Docker Containers , by restricting caching , we can reduce image size. In term of stats , it depends upon the number of python packages multiplied by their respective size . e.g for heavy packages with a lot of dependencies it reduce a lot by don't caching pip packages. Further , more detail information can be found at https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6 Signed-off-by: Pratik Raj <[email protected]>
1 parent 50c2dc1 commit babd9c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker/event-sources/kubernetes/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM bitnami/minideb:jessie
33
RUN install_packages python3 curl ca-certificates git
44
RUN curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
55
RUN python3 ./get-pip.py
6-
RUN pip3 install --upgrade kubernetes
7-
RUN pip3 install --upgrade requests
6+
RUN pip3 install --no-cache-dir --upgrade kubernetes
7+
RUN pip3 install --no-cache-dir --upgrade requests
88

99
RUN git clone --depth 1 https://github.com/dpkp/kafka-python
1010
WORKDIR kafka-python

0 commit comments

Comments
 (0)