-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
InitContainer - inside Step #2507
Comments
Are you trying to add an initContainer inside your step? Can you not add a previous step that does the same thing that your initContainer does? /kind question |
@dibyom - Very sorry for the delay. Since, the tekton step runs as a kubernetes container , user doesn't have access to run certain initializations within the step. That's the reason planned to use InitContainers. Was looking for something similar to Initconainers in Tekton or how Initcontainers can be initiated in Kubernetes. Thanks! |
@2020testuser you can chain multiple steps. Take a look at the tar example in this section. You can find many other examples with multiple steps in the doc. So, I think you can just add a new "InitContainer"-like step before your main step? |
@chanseokoh - I got the application successfully tested with gradle jib. Thanks for all your help. Now , I'm testing with plain gradle (to do time comparison). Note: I need to use the application code 'as is' to test gradle and so unable to use other docker related gradle task that builds the image and pushes to the repository. So, using plain docker command to push the created image to the docker repo. |
Because
|
BTW, doing |
@chanseokoh - The Jib works fine and I will be using it. |
Even before thinking about a secret account, docker config and what not, there is a fundamental issue if you want to use Docker. Basically, using Docker requires root. It is one of the dreaded requirements that people dislike but have to live with. You do need to have elevated privileges to be able to do I heard there is something called "rootless Docker" (experimental), but I am not sure if it really works. |
@chanseokoh - Thanks! Could you please let me know whether having a step (say, step 2) after the gradle step (say step 1)? In that way , step 2 can use Kaniko (or some other mechanism like shared workspace) to pull the built image from step 1 and send as parameter to step 2. gradle user is not needed in step2 but as you mentioned is root usre still needed? Thanks! |
If you have to run Docker commands like Disclaimer: I am not a Tekton expert, and what I say here may be out of date or not ideal. Before I talk about pushing a Docker image from Tekton, I'd like to talk about general file and information sharing between steps. I believe there are multiple ways to achieve this. Maybe the simplest is to use the shared However, I think Tekton has some degree of built-in support for handling Docker image output. This example in the Tutorial explains a
The
Note the same tutorial section also showcases an example where it uses Kaniko. Hope this helps. |
@chanseokoh - Thanks Much for providing more than one option ! Will try out these options. |
@chanseokoh - Thanks! |
I'm going to close this issue as it seems the original question has been largely resolved. Feel free to reopen if there's more to discuss / do here. |
I want to change the permission of the mounted volume in InitContainer (inside Tekton Step).
Can this be done? I'm getting an error when I try to use InitContainers within Step.
I'm using the latest version of Tekton Pipeline. Could anyone please provide more info. on whether InitContainer can be used inside Tekton Step? If not, what are the alternatives?
Thanks in advance!
The text was updated successfully, but these errors were encountered: