-
Bug
-
Resolution: Unresolved
-
Minor
-
None
sh command not working wile specifying user to run inside contrainer.
Example:
docker.image('node:latest').inside('--user node') { stage('Pull repository') { sh 'whoami' }
In this case checkout and other jenkins functions is working, but not any of sh
Process is pending for 5 minutes and then return:
process apparently never started in /var/lib/jenkins/workspace/contrail-ui/contrail-ui-builder@2@tmp/durable-ae2b4ade (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
Error appears to be with any container.
This seems somewhat related to https://github.com/jenkinsci/docker/issues/626#issuecomment-508444712
In my scenario, there are two containers on a kubernetes pod, one is the jnlp-slave.
The directory /home/jenkins/agent/workspace/<jobname>@tmp/durable-831063bb exists and is used for steps running inside the jnlp-container.
The sh-step running inside the other container tries to access the wrong directory and outputs these messages: