Oliver, 
Apologies for the delayed response, but this is a known issue around how 
docker.inside is implemented.  It was very painful when setting up the 
docker image. 

This is why the docs and workflow script for the docker image don't use 
docker.inside 
-- https://github.com/jenkinsci/packaging/blob/master/docker/README.md
When using the packaging image in Jenkins builds, we have to invoke Docker 
manually (or run with arguments) rather than using the inside command. 

The sudo-able packaging test images use a different approach, by applying 
templating to Docker files and rebuilding so you can always have a 
correctly permissioned user. 

After some tinkering, I hit upon a much better way to do this, by 
dynamically creating a user within the container on the fly (which is also 
granted sudo permissions within the container).   There's a PR out for 
this: https://github.com/jenkinsci/packaging/pull/54

It's still pending review from someone though, but it's been tested out and 
works (was actually used for something small).  If it gets the community 
nod, we could merge and have a more robust system (the approach you use 
requires having a local user created). 

Hope that helps clarify somewhat!

Sam




On Friday, September 2, 2016 at 6:06:08 AM UTC-4, ogondza wrote:
>
> I am tying to get jenkinsci/packaging to work from Pipeline using 
> docker-workflow-plugin: 
>
> ``` 
>      builder = docker.build 'jenkins-packaging-builder:0.1' 
>      builder.inside { 
>          sh "make rpm ..." 
>      } 
> ``` 
>
> All seems well except that rpmbuild comaplins at a couple of places: no 
> $HOME is defined, the uid/gid for generated files does not exist in the 
> system. 
>
> The problem is the pluign instructs docker to "use" user with uid/gid 
> matching the outer user (so filesystem can be shared) but the user 
> account does not exist inside. It seems that docker "creates" the user 
> to come extend but it is not fully configured causing tools to fail in 
> weird ways. 
>
> I guess I can switch to use the container as root somehow or update the 
> image to create some user for this purpose but this seems like an 
> inherent struggle with the approach. What is the best practice here? 
>
> In case it is relevant I am using docker 1.10.3 and 
> docker-workflow-plugin 1.6. 
>
> Thanks 
> -- 
> oliver 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/232b7b90-bbb5-4f57-85ee-b8892833f10b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to