Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Dockerfile to reduce image size #136

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,3 +5,4 @@ typecode-libmagic
fosslight_util>=1.4.28
PyYAML
wheel>=0.38.1
intbitset
Loading