From 481ed7f280e28e0e683044d48a833ff52a6c06c8 Mon Sep 17 00:00:00 2001 From: jaehee329 Date: Mon, 11 Sep 2023 09:51:42 +0900 Subject: [PATCH] optimize dockerfile to reduce image size Signed-off-by: jaehee329 --- Dockerfile | 33 +++++++++++++++------------------ requirements.txt | 1 + 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9771d8c..26f1764 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,23 @@ # Copyright (c) 2021 LG Electronics Inc. # SPDX-License-Identifier: Apache-2.0 -FROM ubuntu:20.04 +FROM python:3.8-slim-buster -RUN apt-get clean -RUN apt-get update && apt-get install sudo -y -RUN ln -sf /bin/bash /bin/sh +RUN ln -sf /bin/bash /bin/sh && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + build-essential \ + python3 python3-distutils python3-pip python3-dev python3-magic \ + libxml2-dev libxslt1-dev libhdf5-dev bzip2 xz-utils zlib1g libpopt0 && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -COPY . /app WORKDIR /app -ENV DEBIAN_FRONTEND=noninteractive +COPY . /app -RUN apt-get -y install build-essential -RUN apt-get -y install python3 python3-distutils python3-pip python3-dev -RUN apt-get -y install python3-intbitset python3-magic -RUN apt-get -y install libxml2-dev -RUN apt-get -y install libxslt1-dev -RUN apt-get -y install libhdf5-dev -RUN apt-get -y install bzip2 xz-utils zlib1g libpopt0 -RUN apt-get -y install gcc-10 g++-10 -RUN pip3 install --upgrade pip -RUN pip3 install . -RUN pip3 install dparse +RUN pip3 install --upgrade pip && \ + pip3 install . && \ + pip3 install dparse && \ + rm -rf ~/.cache/pip /root/.cache/pipe -ENTRYPOINT ["/usr/local/bin/fosslight_source"] +ENTRYPOINT ["/usr/local/bin/fosslight_source"] diff --git a/requirements.txt b/requirements.txt index e7732e2..73b543c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ typecode-libmagic fosslight_util>=1.4.28 PyYAML wheel>=0.38.1 +intbitset