Skip to content

Commit 83f9f53

Browse files
committed
optimize size and time using "--no-cache-dir"
Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages by pip don't cached on system . This is a best practise which make sure to fetch ftom repo instead of using local cached one . Further , in case of Docker Containers , by restricing 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 34413ca commit 83f9f53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/keras/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ RUN cd /usr/local/bin && \
3636
ln -s /usr/bin/pip3 pip && \
3737
pip install --upgrade pip setuptools
3838

39-
RUN pip install numpy==1.16.5 tensorflow-gpu==1.15.0 contextlib2==0.6.0 tqdm==4.36.1
40-
RUN pip install tensorflow-datasets==1.2.0
39+
RUN pip install --no-cache-dir numpy==1.16.5 tensorflow-gpu==1.15.0 contextlib2==0.6.0 tqdm==4.36.1
40+
RUN pip install --no-cache-dir tensorflow-datasets==1.2.0

0 commit comments

Comments
 (0)