Support pushing a pre-built tarball #694
Closed
cmellazchy
started this conversation in
Ideas
Replies: 2 comments 4 replies
|
suggestion: integrate scanner into kaniko |
1 reply
|
Please feel free to give it a go, we're always looking for contributors with good ideas #304. Go is simple enough that you can pick it up on an afternoon. From the design I'd probably make it a subcommand similar to |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Use Case
A common security workflow is to scan a container image for vulnerabilities before pushing it to a registry, especially when registry policies (e.g., Harbor) block actions on images with known high/critical CVEs.
Kaniko already supports this halfway: you can build with
--tarPath=/tmp/image.tar --no-push, scan the tarball with a tool like Trivy, and then push if the scan passes. The problem is that last step: kaniko has no way to push a pre-built tarball, so you need an external tool like crane to do it.Workaround Today
This works, but it means downloading, verifying, and installing
craneas an additional binary — even though kaniko already depends ongithub.com/google/go-containerregistry, which is the exact same library thatcranewraps.Proposal
Add a
--push-from-tarflag to supplement the existing--tarPath:When
--push-from-taris set, the executor skips the build entirely and pushes the specified tarball to--destination.The full workflow becomes:
Looking at the codebase, all the building blocks already seem to exist.
Prior Discussion
GoogleContainerTools/kaniko#1638 discussed a similar use case (hooking between build and push). The
--push-from-tarflag is a simpler and more focused solution than the general-purpose hook system discussed there.Does this make sense as a feature request?
I write a lot of code and CI but not Go. That said, I'd love to try contributing this with some guidance and AI Agent blessings, since the scope seems well-defined and the building blocks are all in place.
All reactions