-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: allow injecting through stdin tar.gz on kaniko #1139
feat: allow injecting through stdin tar.gz on kaniko #1139
Conversation
e152e01
to
adec180
Compare
@JordanGoasdoue do you mean after? |
If you are talking about the order of PR to merge. I meant here : Then Merge this second one once it's approuved and only when the first one is merged : #1139 This PR needed the previous one, because i've decided to put the STDIN case inside the local TAR one. Here instead of having a stdin build context by itself, stdin is a sub case of local tar. |
no worries, i think github will take care of merging correctly. I am going threough the process of verifying all approved candidate releases and merged the other one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great feature!!
I know in skaffold, we have an init container which blocks until a file is present. Behind the scenes, we do a docker cp
in to running container the context.tar.
With the --interactive
flag, we don't need to do this anymore. As mentioned in the linked issue #350 this is
also useful for other scenarios.
I really need time to test and run this in interactive mode in a k8 container.
If you are happy to provide us some steps or detailed logs i can get this in quicker.
@samos123 would you be up for testing this?
README.md
Outdated
|
||
Complete example of how to interactively run kaniko with `.tar.gz` Standard Input data, using docker: | ||
```shell | ||
echo 'FROM alpine \nRUN echo "created from standard input"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | docker run \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo 'FROM alpine \nRUN echo "created from standard input"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | docker run \ | |
echo -e 'FROM alpine \nRUN echo "created from standard input"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | docker run \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i ran this in docker and it looks good.
Thanks @tejal29 , This is how I got it to work with k8s after some tries : I used kubernetes in docker and a local registry in docker too.
my pod file
My Dockerfile
I hope it will help you testing |
adec180
to
d08a767
Compare
Thanks @JordanGoasdoue i will give it a spin |
I tested the flow and everything looks great! |
@JordanGoasdoue, we really appreciate that you got this feature supported and I've been using it in our pipelines. Do you happen to know if there is a way to make it more dynamic? I have a pipeline that creates 5 dockerbuilds at the same time and I need to create 5 kaniko pods with different names, because running kubectl exec on one pod is error'ing out. |
Thank you @gfvirga, About your question, if I understand it well, I believe it is similar with the issue linked below : The kaniko maintainer explains there that currently kaniko isn't designed yet to support re-usable pod, but it will hopefully in futur as a contributor already assigned the issue to him, but this is a big task because it needs to work for all possible use case. I hope I've answered your question here. |
Thank you for your response, I got what I need to work with the following: Now it generates a temporary pod, builds and deletes it the temporary pod. Love it! |
Very nice @gfvirga, I'm glad it works well for you now, feel free to open a PR to update the README with this kubernetes part, I'm sure it will help others with same use case. |
Fixes #350
Description
feat: allow injecting through stdin tar.gz on kaniko
The idea is explained on the Issue.
Note_1:
Note_2:
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.
tar://stdin
, to use with data catched from standard input only in.tar.gz
format