Skip to content
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

[FR]: squash_tars rule #833

Closed
sin-ack opened this issue May 6, 2024 · 3 comments
Closed

[FR]: squash_tars rule #833

sin-ack opened this issue May 6, 2024 · 3 comments
Labels
enhancement New feature or request untriaged Requires traige

Comments

@sin-ack
Copy link
Contributor

sin-ack commented May 6, 2024

What is the current behavior?

I am using rules_apt to download a set of packages from Debian/Ubuntu repositories, so that I can add those packages to my oci_image as a layer. The problem is that each package has a set of dependencies on its own. In total, we have 67 dependencies right now, which when loaded into Docker as layer-per-package causes it to balk with "too many layers".

Describe the feature

A rule called squash_tars, which takes a set of .tar files as input, and returns a single .tar file. The contents are extracted in input file order and then re-compressed into a single file.

I have a basic implementation of this already and intend to create a PR. I wanted to open an issue first to see whether it would be desired.

@sin-ack sin-ack added the enhancement New feature or request label May 6, 2024
@github-actions github-actions bot added the untriaged Requires traige label May 6, 2024
@thesayyn
Copy link
Collaborator

I recommend https://github.com/GoogleContainerTools/rules_distroless/blob/main/docs/rules.md#flatten, you could alternatively just use a genrule that depends on the tar toolchain.

@sin-ack
Copy link
Contributor Author

sin-ack commented May 22, 2024

Thanks for the recommendation. I'll use that instead.

@sin-ack sin-ack closed this as completed May 22, 2024
@jjmaestro
Copy link

#870 also mentions this... I also think it's a pretty useful functionality to have in a "generic" / utilities library. @thesayyn would you consider moving flatten to bazel-lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

3 participants