Skip to content

Commit

Permalink
Update Dockerfile #3967
Browse files Browse the repository at this point in the history
    * Use setup-mini.cfg in Dockerfile
    * Install proper runtime libraries
    * Install build_essential to build some wheels, then remove it

Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Nov 1, 2024
1 parent 0df1b8e commit 42cb443
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,32 @@ RUN apt-get update \
libgcrypt20 \
libpopt0 \
libzstd1 \
libarchive-dev \
libmagic-dev \
libarchive13 \
libmagic1 \
libmagic-mgc \
7zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
build-essential

# Create directory for scancode sources
WORKDIR /scancode-toolkit

# Copy sources into docker container
COPY . /scancode-toolkit

# Use setup-mini.cfg to avoid installing typecode[full] and extractcode[full]
COPY setup-mini.cfg setup.cfg

# Initial configuration using ./configure, scancode-reindex-licenses to build
# the base license index
RUN ./configure \
&& ./venv/bin/scancode-reindex-licenses

# Remove unnecessary packages
RUN apt-get purge -y build-essential \
&& apt-get autoremove --purge -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Add scancode to path
ENV PATH=/scancode-toolkit:$PATH

Expand Down
2 changes: 1 addition & 1 deletion setup-mini.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ packages =

# use 7zip, libarchive, and libmagic provided on the system
system_provided =
extractcode-7z-system-provided >= 33.0.0
extractcode-7z-system-provided >= 33.0.1
extractcode-libarchive-system-provided >= 33.0.0
typecode-libmagic-system-provided >= 33.0.0

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ packages =

# use 7zip, libarchive, and libmagic provided on the system
system_provided =
extractcode-7z-system-provided >= 33.0.0
extractcode-7z-system-provided >= 33.0.1
extractcode-libarchive-system-provided >= 33.0.0
typecode-libmagic-system-provided >= 33.0.0

Expand Down

0 comments on commit 42cb443

Please sign in to comment.