From ddbd0db1371685c6d93bd1799fc6f40fab18bcd8 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 23 Feb 2017 15:34:58 -0500 Subject: [PATCH] Delete all the various forms of NPM cache They clutter up the image and cause Twistlock to false positive --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5c3d41f2..0a4d0c559 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN add-apt-repository ppa:nginx/development # Install system packages RUN apt-get update && apt-get upgrade -y # 22FEB2017 RUN apt-get install -y \ - dnsmasq \ + dnsmasq \ g++ \ gdb \ gdebi-core \ @@ -120,9 +120,6 @@ RUN optipng -clobber -quiet static/img/**/*.png RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs npm jpegoptim optipng RUN apt-get autoremove -y RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN rm -rf .npm -RUN rm -rf grunt -RUN rm -rf node_modules # Set up the init system ADD conf/init/copy_config_files.sh /etc/my_init.d/ @@ -157,6 +154,14 @@ ADD .git/HEAD GIT_HEAD ADD . . RUN pyclean . +# Cleanup any NPM-related stuff. +RUN rm -rf /root/.npm +RUN rm -rf /.npm +RUN rm -rf /usr/local/lib/node_modules +RUN rm -rf /root/node_modules +RUN rm -rf /node_modules +RUN rm -rf /grunt + # Run the tests ENV RUN_ACI_TESTS False ADD requirements-tests.txt requirements-tests.txt