unify apk installed db for base layer #3879
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Avi Deitcher avi@deitcher.net
- What I did
Fixed an issue wherein multiple layers in
init
trounce each other's apk installed db file.Specifically, let's say I have some images:
Each of the above gets laid out, in order, on the root filesystem.
If all of them have apk packages installed, then all of them have
/lib/apk/db/installed
. However, as this is just a tar stream, the last one (in the above example, fromlinuxkit/ca-certificates
) overwrites the previous. That means that the installed db is out of date.This PR changes it so that we capture all of the
installed
files and concatenate them to have a single one that includes all of them.Right now, it just concatenates, so it likely has duplicates, but it still works. If I can get deduplication before this goes in, I will comment here.
- How I did it
Added a tar wrapper for when the init sections are streamed, so it captures the
/lib/apk/db/installed
databases and then merges them when told to.- How to verify it
CI, plus a manual test to see that it is merged.
- Description for the changelog
init captures all apk installed databases