From 5f7bc48707e9fe2d942feff0607db98d2d3ccf09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Thu, 8 Oct 2015 14:51:06 +0900 Subject: [PATCH] Reduce size of CoreOS ramdisk By disabling pip cache, we're able to reduce the size of generated docker image by 10%. The resulting ramdisk size goes from 229MB to 218MB. It is possible to decrease the size even further by combining all the RUN instructions into one but it doesn't provide a substantial gain and it harms readability. Change-Id: Ie23636fe709ab7c1bcf4d6c51299c173a5b642ac --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9d671a85..af9840a02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,10 +29,10 @@ RUN apt-mark manual python-minimal # Install requirements separately, because pip understands a git+https url # while setuptools doesn't RUN pip install --upgrade pip -RUN pip install -r /tmp/ironic-python-agent/requirements.txt +RUN pip install --no-cache-dir -r /tmp/ironic-python-agent/requirements.txt # This will succeed because all the dependencies were installed previously -RUN pip install /tmp/ironic-python-agent +RUN pip install --no-cache-dir /tmp/ironic-python-agent # Remove no longer needed packages RUN apt-get -y purge gcc-4.6 gcc python2.7-dev git && \