- Notifications
You must be signed in to change notification settings - Fork 236
RFC: add RPM support #146
Description
I am currently having a look at extending containerdiff to support rpm packages to further support SUSE and RedHat based images. But before going down the rabbit hole, I want to have some feedback from the maintainers.
The main issue with RPM is that it doesn't expose its package base as a text file (as apt does) but as Berkeley databases, which complicates things quite a bit. So far, I can think of two potential solutions:
- Run the image in a container and do something like
rpm -qa --qf "%{NAME}\t%{VERSION}\t%{SIZE}\n"
. That's pretty straightforward and avoids to add more dependencies (docker is already vendored), but it requires running a container. - Parse the databases in
/var/lib/rpm/*
. I had a look at some older golang Berkeley bindings that use the C API, but none of them are well maintained, if at all. So I suggest to use the rpm C API directly and write a go library to add those bindings. However, I am not sure how or if the C API runs on Windows. This would require some more research and testing.
I have a strong preference for option (1) as it's more portable while adding no additional dependencies. It only requires dockerd to be running. Option (2) brings up more issues, as the rpm go library must be maintained as well. I'm willing to implement it, but the main focus would be to just get the things in place to extract the relevant data from the databases.
What are your thoughts on that? I can imagine that rpm support has already been considered.