Side note: bootc notes should be refactored into the [virtualization][containers] notes now that it is distro-agnostic.
chunkah helps to speed up updates by reorganizing layers to contain related files. No infrastructure changes are needed.
Steps to use chunkah:
- As the last
RUN command in a container, add file attribute tags for related files (it is recommended to tag all files from each individual package as being related).
- Run
chunkah on the built container to reorganize the layers based on those file attributes.
https://github.com/coreos/chunkah
Example of step 1 for different Lnux distributions:
Arch Linux:
pacman -Qq | while read -r pkgname; do
echo "Setting file attributes for package: $pkgname (chunkah)"
pacman -Qlq "$pkgname" | while read -r filepath; do
if [[ -f "$filepath" ]]; then
setfattr -n user.component -v "$pkgname" "$filepath" || true
fi
done
done
Debian:
# Set file attributes for packages for chunkah to handle.
dpkg-query -W -f='${Package}\n' | while read -r pkgname; do
echo "Setting file attributes for package: $pkgname (chunkah)"
dpkg -L "$pkgname" | while read -r filepath; do
if [[ -f "$filepath" ]]; then
setfattr -n user.component -v "$pkgname" "$filepath" || true
fi
done
done
https://github.com/frostyard/snosi/blob/09d22407f138307f94b6440fac1d3484a53a5bd3/shared/outformat/image/finalize/mkosi.finalize.chroot#L41
Fedora:
rpm -qa | while read -r pkgname; do
echo "Setting file attributes for package: $pkgname (chunkah)"
rpm -ql "$pkgname" | while read -r filepath; do
if [[ -f "$filepath" ]]; then
setfattr -n user.component -v "$pkgname" "$filepath" || true
fi
done
done
Side note:
bootcnotes should be refactored into the [virtualization][containers] notes now that it is distro-agnostic.chunkah helps to speed up updates by reorganizing layers to contain related files. No infrastructure changes are needed.
Steps to use chunkah:
RUNcommand in a container, add file attribute tags for related files (it is recommended to tag all files from each individual package as being related).chunkahon the built container to reorganize the layers based on those file attributes.https://github.com/coreos/chunkah
Example of step 1 for different Lnux distributions:
Arch Linux:
Debian:
https://github.com/frostyard/snosi/blob/09d22407f138307f94b6440fac1d3484a53a5bd3/shared/outformat/image/finalize/mkosi.finalize.chroot#L41
Fedora: