-
Notifications
You must be signed in to change notification settings - Fork 72
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
[REQ] Support RPM-based images with valid rpm status but missing tools #602
Comments
I've done some of the initial work required for this feature which is available in my fork of the repo available here. There are two approaches we can take to this feature, both of which are documented below. Approach 1 - Reusing The Approach Used For DistrolessThis is the approach currently taken in my fork of the repo linked above. While it generally works, there are 2 roadblocks that prevent this from working flawlessly.
To fix the first issue, we could add 3rd party The second issue will require further investigation for me to determine why that directory is missing. Reproducing Above IssuesClone my git branch (https://github.com/MiahaCybersec/copacetic/tree/valid-rpm-status-no-tools) With no further changes, using the To skip over missing packages in the CBL mariner package manager repos, add From here, choose an image that is missing RPM tools. There are two images I've been working with below as examples.
Once the above changes are made, we can reliably reproduce the second issue. Approach 2 - Adding a New FunctionThis approach would allow us to handle images which have a valid RPM status but missing tools differently than a distroless image. While I have started initial work on this locally, I will likely need additional time and help learning LLB and BuildKit. Due to this approach relying upon the CBL mariner tooling image, we'd still run into the first issue listed under the first approach. It is possible other issues may arise while taking this approach, but those issues are not currently known if they exist. |
@MiahaCybersec The Since this folder does not exist for non-distroless images, it might be best to add a new function that follows the same workflow as This tool can help you visualize image filesystems to see the distroless vs non-distroless image structure - https://oci.dag.dev/ |
Regarding the missing packages, I'm not sure if we would be able to get around that without |
Thanks for the clarification Ashna! I've begun working on implementing the function to mount the necessary tools into the user supplied image if the tools are missing. I'll do my best to keep the issue updated as progress is made. |
The function is mostly implemented locally, but some additional debugging will be required before it works properly. I'm hoping to have a PR up to close this issue later this week. I'll update the issue if there are any roadblocks that may delay this feature being implemented. |
I've implemented the function, but I'm encountering an issue at line 464 of rpm.go. You can find the current code here. The program currently throws the following error:
I've tried using different directories for the binaries, but the error persists. To diagnose the issue further, I'm exploring two options:
|
I have a somewhat functional build, but it appears that in order to get it fully operational, we will need to deal with dynamically linked libraries. All of the code I'm referring to is on my fork of Copa. In order to execute anything, we must invoke Once It's worth noting that these same errors apply to both the user supplied image and tooling image bash shells. I have been investigating |
Thank you for tackling this. Any hope that it will get implemented into copacetic? |
I have discussed it with the Copa team and it seems like the best path forward would be with a statically linked RPM binary. Since we haven't been able to find one that's readily available in a distribution's repository, we're currently waiting on input from @sozercan. |
What kind of request is this?
None
What is your request or suggestion?
copacetic/pkg/pkgmgr/rpm.go
Line 333 in d648155
Turning copacetic TODO comments into issues from https://docs.google.com/spreadsheets/d/1XwNj1J6e2FrUhlqaIsV10l8_tgov7WodlkvpNZXYZMU/edit#gid=1386834576.
Are you willing to submit PRs to contribute to this feature request?
The text was updated successfully, but these errors were encountered: