Skip to content

Commit

Permalink
Dockerfile: run apt-get install --no-install-recommends
Browse files Browse the repository at this point in the history
This reduces the packages being installed, and thus the overal container
image build time and size. We do need to explicitly specify libc6-dev
now.

Before:
2 upgraded, 69 newly installed, 0 to remove and 15 not upgraded.
Need to get 70.5 MB of archives.A
After this operation, 267 MB of additional disk space will be used.

After:
2 upgraded, 34 newly installed, 0 to remove and 15 not upgraded.
Need to get 54.0 MB of archives.
After this operation, 210 MB of additional disk space will be used.
  • Loading branch information
stintel committed Oct 25, 2023
1 parent c6917fa commit 7303231
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
COPY requirements.txt .

# Install gcc temporarily until wheels for httptools on Python 3.12 are available
RUN apt-get update && apt-get install -y gcc libmagic1 && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install --no-install-recommends -y gcc libc6-dev libmagic1 && rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/root/.cache pip install -r requirements.txt

Expand Down

0 comments on commit 7303231

Please sign in to comment.