-
Notifications
You must be signed in to change notification settings - Fork 577
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
Gradle Jib - Run as root user? #289
Comments
Could someone reply to the above please ? (if you have the info.)Thanks! |
Didn't dig too deep but #214. On OpenShift, jib had to be root to run, but I think it's something related to |
Correct. Note that the root cause of the issue #214 is from Gradle, not Jib. Running Gradle (even without Jib) does need to write some Gradle stuff (like Java JAR artifacts downloaded for caching), but the directory at BTW, I know there's a plan to remove Refs: |
Thanks Much for the explanation.Getting to understand the original cause of the issue. Could you please let me know whether the below would solve the problem for now?
Since, the volume used by the Task cannot be used in 'write' mode by the non-root user (to store cache data, logs etc.), the TaskRun fails. I'm using Docker Hub's gradle 4.6 image (and included the Jib plugin setup as part of my project's build.gradle file) and not using Google Tool's Gradle Jib Image (used in the Jib Gradle example in Tekton Catalog ) as I'm using old version of Gradle (4.6) and Jib. Thanks! =================================================================
|
Before I explain other things, I think this is what's happening to you.
I'm not a Tekton expert, but from my recent experiments, I think there are a few options for these issues on Tekton. For 2), you can change the "Gradle User Home" with the flag For 3), I guess you are probably getting project source from a remote git repo. What I learned is that, if you set So, in sum, try these
Lastly, I don't really get the real connection between using a ServiceAccount and permissions of a mounted volume. In my testing with Tekton, whatever volumes I mount is always globally writable. For initial testing, you can first try an |
Every time I read your explanation , I'm learning something new . Thanks Much! I'm using PersistentVolumeClaim now. Will try the above and do testing . Will keep posted on the findings. Thanks again! |
Great. And, actually, just realized it should be |
Finally, I was able to get it working. Appreciate all your inputs. Thanks a lot! |
Does Tekton Gradle Jib need to be run as user? I need to deploy the Jib Gradle built application in Kubernetes in its own Pod. So, if I run the Gradle build task as root -user, when I deploy using Tekton Pipeline in Kubernetes, because of enabled Pod RBAC, my deployment will fail.
Could anyone please provide more insight on this? Is using a ServiceAccount solve the issue?
Also, to push to the organization's docker registry, does any additional setting needed in gradle/jib properties/config file?
Any info. would be greatly helpful.
Thanks!
The text was updated successfully, but these errors were encountered: