From 9cf75b351a220c6b53d5253725e5618cd640d22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 17 Nov 2023 07:42:34 +0100 Subject: [PATCH] strip buildtime dependencies from docker image --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 81daee6..516f317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,17 +53,21 @@ EXPOSE 8000 COPY api ./ RUN set -ex; \ - # install libs + # building hiredis + BUILD_DEPS="${BUILD_DEPS:-} gcc libc6-dev"; \ + \ + # install dependencies export DEBIAN_FRONTEND=noninteractive; \ apt-get update; apt-get install --yes --no-install-recommends \ libmagic1 \ - # need to build hiredis - gcc \ - libc-dev \ + ${BUILD_DEPS:-} \ ; rm -rf /var/lib/apt/lists/*; \ \ # install ovdashboard_api - python3 -m pip --no-cache-dir install ./ + python3 -m pip --no-cache-dir install ./; \ + \ + # remove buildtime dependencies + apt-get autoremove --yes --purge ${BUILD_DEPS:-}; # add prepared ovdashboard_ui COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui