From fc5e5e21e50339102daea09568f325ae53abd300 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 4 Jan 2020 20:52:31 +0100 Subject: [PATCH] Ensure unwanted artifacts are removed during build --- Dockerfiles/work/Dockerfile-5.2 | 4 +++- Dockerfiles/work/Dockerfile-5.3 | 6 ++++-- Dockerfiles/work/Dockerfile-5.4 | 6 ++++-- Dockerfiles/work/Dockerfile-5.5 | 6 ++++-- Dockerfiles/work/Dockerfile-5.6 | 6 ++++-- Dockerfiles/work/Dockerfile-7.0 | 6 ++++-- Dockerfiles/work/Dockerfile-7.1 | 6 ++++-- Dockerfiles/work/Dockerfile-7.2 | 6 ++++-- Dockerfiles/work/Dockerfile-7.3 | 6 ++++-- Dockerfiles/work/Dockerfile-7.4 | 6 ++++-- Dockerfiles/work/Dockerfile-8.0 | 6 ++++-- build/ansible/DOCKERFILES/Dockerfile-work.j2 | 2 ++ build/ansible/group_vars/all/work.yml | 4 ++-- 13 files changed, 47 insertions(+), 23 deletions(-) diff --git a/Dockerfiles/work/Dockerfile-5.2 b/Dockerfiles/work/Dockerfile-5.2 index 7282231..f73c282 100644 --- a/Dockerfiles/work/Dockerfile-5.2 +++ b/Dockerfiles/work/Dockerfile-5.2 @@ -191,7 +191,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -339,6 +339,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -472,6 +473,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 1093d26..0187c4b 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -208,7 +208,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -264,7 +264,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -395,6 +395,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -536,6 +537,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index 96e868e..a99a50e 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -237,7 +237,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -293,7 +293,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -428,6 +428,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -573,6 +574,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 5c36aca..65329b2 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -241,7 +241,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -298,7 +298,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -445,6 +445,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -594,6 +595,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index 517e3a0..f2d9912 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -311,7 +311,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -458,6 +458,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -608,6 +609,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 543ae26..2f907d0 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -311,7 +311,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -458,6 +458,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -608,6 +609,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 4d82ea8..bc6a252 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -311,7 +311,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -458,6 +458,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -608,6 +609,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index 3b9732f..dec6576 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -312,7 +312,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -459,6 +459,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -609,6 +610,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index c1dbe1b..80c2e97 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -298,7 +298,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -445,6 +445,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -594,6 +595,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-7.4 b/Dockerfiles/work/Dockerfile-7.4 index 0c8499b..841100d 100644 --- a/Dockerfiles/work/Dockerfile-7.4 +++ b/Dockerfiles/work/Dockerfile-7.4 @@ -254,7 +254,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -293,7 +293,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -440,6 +440,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -588,6 +589,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/Dockerfiles/work/Dockerfile-8.0 b/Dockerfiles/work/Dockerfile-8.0 index b8353fa..fb87795 100644 --- a/Dockerfiles/work/Dockerfile-8.0 +++ b/Dockerfiles/work/Dockerfile-8.0 @@ -197,7 +197,7 @@ RUN set -eux \ \ \ # -------------------- mhsendmail -------------------- - && wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + && wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ \ @@ -236,7 +236,7 @@ RUN set -eux \ \ \ # -------------------- phpmd -------------------- - && wget -c https://phpmd.org/static/latest/phpmd.phar \ + && wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ \ @@ -359,6 +359,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -497,6 +498,7 @@ RUN set -eux \ && sass --version | grep -E '[.0-9]+' \ \ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/build/ansible/DOCKERFILES/Dockerfile-work.j2 b/build/ansible/DOCKERFILES/Dockerfile-work.j2 index 396fbe2..5dd1d08 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-work.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-work.j2 @@ -308,6 +308,7 @@ RUN set -eux \ && su -c '. /opt/nvm/nvm.sh; npm cache clear --force' devilbox \ && su -c '. /opt/nvm/nvm.sh; nvm cache clear --force' devilbox \ && rm -rf /home/devilbox/.npm \ + && rm -rf /home/devilbox/.cache \ && rm -rf /home/devilbox/.config \ && rm -rf /tmp/* \ && (rm -rf /tmp/.* || true) \ @@ -502,6 +503,7 @@ RUN set -eux \ {%- endif -%} {% endfor %}{{ "\n\t" }}\ # -------------------- Cleanup -------------------- + && rm -rf /home/devilbox/.cache/ \ && rm -rf /home/devilbox/.config/ \ && rm -rf /root/.ansible \ && rm -rf /root/.console \ diff --git a/build/ansible/group_vars/all/work.yml b/build/ansible/group_vars/all/work.yml index de6d877..d57f686 100644 --- a/build/ansible/group_vars/all/work.yml +++ b/build/ansible/group_vars/all/work.yml @@ -572,7 +572,7 @@ software_available: mhsendmail: all: command: | - wget https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ + wget --no-hsts https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 \ && chmod +x mhsendmail_linux_amd64 \ && mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail \ mysqldumpsecure: @@ -737,7 +737,7 @@ software_available: check: phpmd --version | grep -E '^PHPMD [.0-9]+' all: command: | - wget -c https://phpmd.org/static/latest/phpmd.phar \ + wget --no-hsts https://phpmd.org/static/latest/phpmd.phar \ && mv phpmd.phar /usr/local/bin/phpmd \ && chmod +x /usr/local/bin/phpmd \ phpunit: