From c0d00aa6372eea131be188fbe607f96b8ae9a2d7 Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Fri, 14 Oct 2022 10:07:38 +0200 Subject: [PATCH] Dockerfile: avoid deploy the python pip cache This patch prevents deployment of the pip cache folder that is only needed during installation. Which is also done with the apt, where at the end of the install operation we delete the cache and all temporary folders. The reducion of the image size is insignificant: | builder@1373d0b95f44:/build$ sudo du -sh /root/.cache/pip | 1.6M /root/.cache/pip Signed-off-by: Jose Quaresma Signed-off-by: Jan Kiszka --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 48e2efc..488539d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,8 @@ COPY . /kas RUN chmod -R o-w /kas RUN pip3 --proxy=$https_proxy install --no-deps kconfiglib && \ - pip3 --proxy=$https_proxy install --no-deps /kas && kas --version + pip3 --proxy=$https_proxy install --no-deps /kas && kas --version && \ + rm -rf $(pip3 cache dir) RUN ln -s /kas/contrib/oe-git-proxy /usr/bin/ ENV GIT_PROXY_COMMAND="oe-git-proxy" \