From 6b748a63767064f0c1e5e61364b87c2f836156b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Roz=C3=A9?= Date: Wed, 3 Jan 2024 18:08:56 +0100 Subject: [PATCH] Slim docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base the dockerfile on slim python image. This roughly reduces image size by 75%. Signed-off-by: David Rozé --- Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57e1845..5228365 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,20 @@ -FROM python:3 -RUN git config --global user.email repo-resource@concourse-ci.org && \ - git config --global user.name repo-resource && \ - git config --global color.ui never +FROM python:3-slim + +RUN apt update \ + && apt install -y git procps \ + && apt upgrade -y \ + && apt autoremove \ + && rm -rf /var/lib/apt/lists/* + +RUN git config --global user.email repo-resource@concourse-ci.org \ + && git config --global user.name repo-resource \ + && git config --global color.ui never COPY ssh_config /root/.ssh/config COPY repo_resource/requirements.txt /opt/resource/requirements.txt RUN pip install -r opt/resource/requirements.txt + COPY repo_resource/check.py /opt/resource/check COPY repo_resource/in_.py /opt/resource/in COPY repo_resource/out.py /opt/resource/out