Skip to content

Commit 4133d5e

Browse files
authored
Optimize dockerfile to reduce image size (#136)
Signed-off-by: jaehee329 <[email protected]>
1 parent dcc745f commit 4133d5e

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

Dockerfile

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
# Copyright (c) 2021 LG Electronics Inc.
22
# SPDX-License-Identifier: Apache-2.0
3-
FROM ubuntu:20.04
3+
FROM python:3.8-slim-buster
44

5-
RUN apt-get clean
6-
RUN apt-get update && apt-get install sudo -y
7-
RUN ln -sf /bin/bash /bin/sh
5+
RUN ln -sf /bin/bash /bin/sh && \
6+
apt-get update && \
7+
apt-get install --no-install-recommends -y \
8+
build-essential \
9+
python3 python3-distutils python3-pip python3-dev python3-magic \
10+
libxml2-dev libxslt1-dev libhdf5-dev bzip2 xz-utils zlib1g libpopt0 && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
813

9-
COPY . /app
1014
WORKDIR /app
1115

12-
ENV DEBIAN_FRONTEND=noninteractive
16+
COPY . /app
1317

14-
RUN apt-get -y install build-essential
15-
RUN apt-get -y install python3 python3-distutils python3-pip python3-dev
16-
RUN apt-get -y install python3-intbitset python3-magic
17-
RUN apt-get -y install libxml2-dev
18-
RUN apt-get -y install libxslt1-dev
19-
RUN apt-get -y install libhdf5-dev
20-
RUN apt-get -y install bzip2 xz-utils zlib1g libpopt0
21-
RUN apt-get -y install gcc-10 g++-10
22-
RUN pip3 install --upgrade pip
23-
RUN pip3 install .
24-
RUN pip3 install dparse
18+
RUN pip3 install --upgrade pip && \
19+
pip3 install . && \
20+
pip3 install dparse && \
21+
rm -rf ~/.cache/pip /root/.cache/pipe
2522

26-
ENTRYPOINT ["/usr/local/bin/fosslight_source"]
23+
ENTRYPOINT ["/usr/local/bin/fosslight_source"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ typecode-libmagic
55
fosslight_util>=1.4.28
66
PyYAML
77
wheel>=0.38.1
8+
intbitset
89
fosslight_binary

0 commit comments

Comments
 (0)