From bf77dee1f6525aab77438d1bc8592d4c7d5f1147 Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Fri, 10 Nov 2023 10:42:23 +0100 Subject: [PATCH 1/5] Official Debian images automatically run `apt-get clean` https://docs.docker.com/develop/develop-images/instructions/#apt-get --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ce485f..25efc45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,6 @@ RUN set -x \ make \ openssh-client \ rsync \ - && apt clean \ - && apt autoclean \ && curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ && tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ && rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ @@ -33,7 +31,7 @@ RUN set -x \ && curl -Lo ct https://github.com/coreos/container-linux-config-transpiler/releases/download/v${VERSION_CT}/ct-v${VERSION_CT}-x86_64-unknown-linux-gnu \ && chmod +x ct \ && mv ct /usr/local/bin/ \ - && rm -rf /var/cache/apt/* /tmp/* + && rm -rf /tmp/* COPY ansible.cfg /etc/ansible/ansible.cfg From 128d90be176cb93d4fe486f879dc83fc57dad6fd Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Fri, 10 Nov 2023 10:43:45 +0100 Subject: [PATCH 2/5] Remove package list of apt --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 25efc45..d50cfa4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN set -x \ make \ openssh-client \ rsync \ + && rm -rf /var/lib/apt/lists/* \ && curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ && tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ && rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \ From b63a3e11a557098b7786132407838bb4645edf33 Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Fri, 10 Nov 2023 10:44:43 +0100 Subject: [PATCH 3/5] pip is updated by base image --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d50cfa4..3a20b6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,6 @@ RUN set -x \ && gcloud components install gke-gcloud-auth-plugin \ && gcloud --version \ && curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -s -- --version "v${VERSION_HELM}" \ - && python3 -m pip install --upgrade pip \ && python3 -m pip install ansible==${VERSION_ANSIBLE} Jinja2==3.1.2 netaddr==0.8.0 humanfriendly==9.2 jmespath==1.0.1 kubernetes==25.3.0 pyjwt==2.8.0 passlib==1.7.4 \ && curl -Lo ct https://github.com/coreos/container-linux-config-transpiler/releases/download/v${VERSION_CT}/ct-v${VERSION_CT}-x86_64-unknown-linux-gnu \ && chmod +x ct \ From 7daff073110eeb705fd83c81ca24bb3cbd2b2f28 Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Fri, 10 Nov 2023 10:45:29 +0100 Subject: [PATCH 4/5] Deactivate pip cache --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3a20b6f..471137c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,15 @@ RUN set -x \ && gcloud components install gke-gcloud-auth-plugin \ && gcloud --version \ && curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -s -- --version "v${VERSION_HELM}" \ - && python3 -m pip install ansible==${VERSION_ANSIBLE} Jinja2==3.1.2 netaddr==0.8.0 humanfriendly==9.2 jmespath==1.0.1 kubernetes==25.3.0 pyjwt==2.8.0 passlib==1.7.4 \ + && python3 -m pip install --disable-pip-version-check --no-cache-dir \ + ansible==${VERSION_ANSIBLE} \ + Jinja2==3.1.2 \ + netaddr==0.8.0 \ + humanfriendly==9.2 \ + jmespath==1.0.1 \ + kubernetes==25.3.0 \ + pyjwt==2.8.0 \ + passlib==1.7.4 \ && curl -Lo ct https://github.com/coreos/container-linux-config-transpiler/releases/download/v${VERSION_CT}/ct-v${VERSION_CT}-x86_64-unknown-linux-gnu \ && chmod +x ct \ && mv ct /usr/local/bin/ \ From 73f54335986824207ac7a448f2d5e091f98b3af6 Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Fri, 10 Nov 2023 10:45:44 +0100 Subject: [PATCH 5/5] Remove gcloud backup --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 471137c..8b718b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN set -x \ && gcloud config set component_manager/disable_update_check true \ && gcloud config set metrics/environment github_docker_image \ && gcloud components install gke-gcloud-auth-plugin \ + && rm -rf /google-cloud-sdk/.install/.backup \ && gcloud --version \ && curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -s -- --version "v${VERSION_HELM}" \ && python3 -m pip install --disable-pip-version-check --no-cache-dir \