Duh. I needed to reboot/restart, blah, blah.

I did this inside my pipeline:

     sh 'id'

+ id
uid=119(jenkins) gid=128(jenkins) groups=128(jenkins),120(docker


Yeah! - Jenkins is there.


This was the key:


    sudo usermod -aG docker jenkins


25 years as a developer and I still forget to reboot.


On Saturday, December 3, 2016 at 11:00:02 AM UTC-8, [email protected] wrote:
>
> Inside Pipeline this works 
>
>    sh 'docker info'
>
>
> But if I do:
>
>   sh 'python mycode.py'
>
> I get an error:
>
>     Unable to locate docker daemon
>
> I did the usermod -aG command and verified Jenkins is partof the docker 
> group.
>
> Is DOCKER_HOST missing from inside of Pipeline?
>
>     sh 'whoami'
>
> ...does reveal "Jenkins"
>
> Bottom line, docker commands work directly from Pipeline but not using the 
> "subprocess" package inside of Python.
>
> Not sure what I should try next.
>
> Thanks...
> Bruno Terkaly
>
>

-- 
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/d6fc1df4-08b2-4c17-93a8-ca75cf830f3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to