Skip to content

Commit

Permalink
Optimize dockerfile to reduce image size (#136)
Browse files Browse the repository at this point in the history
Signed-off-by: jaehee329 <[email protected]>
  • Loading branch information
jaehee329 authored Sep 16, 2023
1 parent dcc745f commit 4133d5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
33 changes: 15 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ typecode-libmagic
fosslight_util>=1.4.28
PyYAML
wheel>=0.38.1
intbitset
fosslight_binary

0 comments on commit 4133d5e

Please sign in to comment.