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

Minimize apt installed packages in Dockerfile #943

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

PeterDaveHello
Copy link
Contributor

@PeterDaveHello PeterDaveHello commented Sep 9, 2023

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 is making the Docker image size smaller, also kind of a Dockerfile best practice:

Before:

REPOSITORY                               TAG                  IMAGE ID       CREATED          SIZE
dockerfile.py36-delete-apt-lists         latest               a89aff9d354e   5 days ago       961MB
dockerfile.py310-delete-apt-lists        latest               d09266ce3fc2   5 days ago       978MB
dockerfile.py311-delete-apt-lists        latest               81d19c55cb4d   5 days ago       999MB

After:

REPOSITORY                                   TAG              IMAGE ID       CREATED          SIZE
dockerfile.py36-apt-no-install-recommends    latest           b34141d8cdef   5 days ago       954MB
dockerfile.py310-apt-no-install-recommends   latest           9eccdbb71cc8   15 minutes ago   972MB
dockerfile.py311-apt-no-install-recommends   latest           686a781c50f2   13 minutes ago   993MB

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
@codecov-commenter
Copy link

Codecov Report

Patch has no changes to coverable lines.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

📢 Thoughts on this report? Let us know!.

@caronc caronc merged commit f6f73b6 into caronc:master Sep 9, 2023
12 checks passed
@PeterDaveHello PeterDaveHello deleted the DockerfileAptLists branch September 9, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants