In my case I was able to get sh commands working inside the container by adding a user to the docker image with the uid/gid that was being specified on the docker run command executed by the plugin (the local jenkins userid and group).
On Thursday, October 1, 2015 at 12:28:54 PM UTC-4, Ross Vandegrift wrote: > > Hello all, > > I'm using the workflow plugin with the jenkins:latest docker container, > and I need to run jobs inside of other containers. I've given jenkins > access to /var/run/docker.sock and it can run a new container from a > workflow. > > But if there's a sh step in that container, the jenkins job freezes. > Symptoms are the same as [1], but I don't think write access is the > issue. Te workspace dir has mode 0777, and jenkins is running as root. > > Jenkins successfully creates the script for the sh step, but either it > runs and misses the result, or it never executes: > root@ab9ed8e40baf:/var/jenkins_home/jobs/docker-example/workspace# ls -laR > .: > total 12 > drwxrwxrwx 3 root root 4096 Sep 28 15:39 . > drwxr-xr-x 4 root root 4096 Sep 28 15:07 .. > drwxr-xr-x 2 root root 4096 Sep 28 15:07 .3413c672 > > ./.3413c672: > total 12 > drwxr-xr-x 2 root root 4096 Sep 28 15:07 . > drwxrwxrwx 3 root root 4096 Sep 28 15:39 .. > -rwxr-xr-x 1 root root 18 Sep 28 15:07 script.sh > root@ab9ed8e40baf:/var/jenkins_home/jobs/docker-example/workspace# cat > .3413c672/script.sh > #!/bin/sh -xe > true > > > Any hints? > > Ross > > [1] - https://issues.jenkins-ci.org/browse/JENKINS-28821 > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3812a022-fa1d-41dc-bf51-811253797ce5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
