strip buildtime dependencies from docker image

This commit is contained in:
Jörn-Michael Miehe 2023-11-17 07:42:34 +01:00
parent 092f336870
commit 9cf75b351a

View file

@ -53,17 +53,21 @@ EXPOSE 8000
COPY api ./ COPY api ./
RUN set -ex; \ RUN set -ex; \
# install libs # building hiredis
BUILD_DEPS="${BUILD_DEPS:-} gcc libc6-dev"; \
\
# install dependencies
export DEBIAN_FRONTEND=noninteractive; \ export DEBIAN_FRONTEND=noninteractive; \
apt-get update; apt-get install --yes --no-install-recommends \ apt-get update; apt-get install --yes --no-install-recommends \
libmagic1 \ libmagic1 \
# need to build hiredis ${BUILD_DEPS:-} \
gcc \
libc-dev \
; rm -rf /var/lib/apt/lists/*; \ ; rm -rf /var/lib/apt/lists/*; \
\ \
# install ovdashboard_api # 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 # add prepared ovdashboard_ui
COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui