From da84740000dd4a9da91ad50967c78f8dd8caf894 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 8 Dec 2020 23:47:07 +0800 Subject: [PATCH 1/2] Remove `--no-cache` for `apk` in Dockerfile As there is `apk upgrade` and `apk update`, the apk index will already be existed. `--no-cache` is for `apk` when there is no `apk update` behavior and it's expected to be no local cache left, not suitable for the use case here, which wants to upgrade all the package to the latest when packaging the image. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 42a6941..1859869 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.11 RUN apk update && \ apk upgrade && \ - apk add --no-cache bash procps drill git coreutils libidn curl && \ + apk add bash procps drill git coreutils libidn curl && \ addgroup testssl && \ adduser -G testssl -g "testssl user" -s /bin/bash -D testssl && \ ln -s /home/testssl/testssl.sh /usr/local/bin/ && \ From abc5694408b5121ec7ae400c3644918d5bd60570 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 8 Dec 2020 23:52:04 +0800 Subject: [PATCH 2/2] Clean up apk cache in Dockerfile after packages installed This will make the image smaller. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1859869..279e315 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM alpine:3.11 RUN apk update && \ apk upgrade && \ apk add bash procps drill git coreutils libidn curl && \ + rm -rf /var/cache/apk/* && \ addgroup testssl && \ adduser -G testssl -g "testssl user" -s /bin/bash -D testssl && \ ln -s /home/testssl/testssl.sh /usr/local/bin/ && \