Hi,

I have a Jenkinsfile with the following docker step:

          agent {
            dockerfile {
              filename "Dockerfile"
            }
          }
          steps {
              sh 'cd sites/all/themes/custom/zen; npm install; gulp'
          }


And my Dockerfile consists of: 

FROM node:7.7

RUN npm install gulp gulp-cli -g



Which installs the npm packages that are required by the project and runs 
the necessary gulp commands as well. When I try doing the step without 
Jenkins (manually docker run) the script runs correctly. However, when I 
run via Jenkins and the Jenkinsfile, I get permission denied errors with 
the files the attempted install paths being quite different from where they 
would normally be. On further investigation of the jenkins command:

docker run -t -d -u 110:115 -w /workspace-dir -v 
/workspace-dir:/workspace-dir:rw ...


I found that the -u flag was using the uid/gid of my Jenkins user on the host 
(which does not exist in my image). Currently, my jenkins install is not via 
jenkins (its installed via apt on an ubuntu server). So I'm not entirely sure 
of what would be the best approach to this issue. Should I be creating a user 
with the same uid/gid via docker? Or is there some other recommended approach 
to do this?


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e0ec06df-b645-46a1-b7c8-9b38ea807601%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to