rust-vmm / rust-vmm-container

Container with all dependencies required for running rust-vmm crates integration tests.
Apache License 2.0
65 stars 32 forks source link

Make Dockerfile multi-stage #90

Closed epilys closed 11 months ago

epilys commented 11 months ago

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: