Skip to content

Commit

Permalink
Minimize apt installed packages in Dockerfile (#943)
Browse files Browse the repository at this point in the history
Use `apt-get install` with `--no-install-recommends` to void unnecessary
packages, and manually add `dbus` package to prevent build failure with
command `pip install --no-cache-dir dbus-python PyGObject` like below:

> #0 22.28       Program dbus-run-session found: NO
> #0 22.28
> #0 22.28       ../test/meson.build:72:19: ERROR: Program 'dbus-run-session' not found or not executable
  • Loading branch information
PeterDaveHello authored Sep 9, 2023
1 parent f799066 commit f6f73b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.py310
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Base
FROM python:3.10-buster
RUN apt-get update && \
apt-get install -y libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash && \
apt-get install -y --no-install-recommends libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash dbus && \
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir dbus-python PyGObject

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.py311
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Base
FROM python:3.11-buster
RUN apt-get update && \
apt-get install -y libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash && \
apt-get install -y --no-install-recommends libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash dbus && \
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir dbus-python PyGObject

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.py36
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Base
FROM python:3.6-buster
RUN apt-get update && \
apt-get install -y libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash && \
apt-get install -y --no-install-recommends libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash dbus && \
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir dbus-python PyGObject

Expand Down

0 comments on commit f6f73b6

Please sign in to comment.