Minimize apt installed packages in Dockerfile (#943)

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
This commit is contained in:
Peter Dave Hello 2023-09-10 02:22:51 +08:00 committed by GitHub
parent f799066e0f
commit f6f73b69b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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