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

Make Dockerfile multi-stage #90

Closed
wants to merge 3 commits into from

Conversation

epilys
Copy link
Member

@epilys epilys commented Oct 17, 2023

Depends on #88
Obsoletes #89

Summary of the PR

By making the build multi-stage, we get several benefits:

  • Independent stages can run in parallel.
  • Stages are separate layers which are cached.
  • Changes to one stage don't cause rebuilds on stages that don't depend
    on it.
  • Only files from the final stage end up in the final image.

The tricky part is making sure every necessary thing ends up in the image.
Right now /usr and /etc are copied entirely which should cover most things.
Doing an apt remove for libgpiod and pipewire build-only dependencies will also bring the image size down.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

vhost-device-sound has an ALSA audio backend that dynamically links to
library libasound2 and also needs its development headers.

Signed-off-by: Manos Pitsidianakis <[email protected]>
The system library package for libpipewire-0.3 in the used ubuntu image
is not recent enough for the pipewire bindings crate vhost-device-sound
uses, so build and install it manually.

Signed-off-by: Manos Pitsidianakis <[email protected]>
By making the build multi-stage, we get several benefits:

- Independent stages can run in parallel.
- Stages are separate layers which are cached.
- Changes to one stage don't cause rebuilds on stages that don't depend
  on it.
- Only files from the final stage end up in the final image.

Signed-off-by: Manos Pitsidianakis <[email protected]>
@epilys epilys closed this Oct 17, 2023
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.

2 participants