-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins ver. 2.138.2
A docker.image.inside block causes Jenkins to run a 'docker run ... cat' command and later a docker exec command. The run command runs as the Jenkins user (specifically with the same uid), while docker exec runs as root. The result is that files created withing the inside block has root owners in the workplace, causing issues in later stages.
I would expect the opposite behavior. "docker run ... cat" should run as root, in order to be able to initialize the docker container. Specifically I have to create a user with the same uid as the jenkins user of the agent (otherwise sudo, ssh will not work). On the other hand docker exec, which does the actual build job, should run under the jenkins user uid, so the owner of the newly created files in mounted directories is the jenkins user.
- duplicates
-
JENKINS-49437 Impossible to specify user/uid to use inside container
- Open
- is related to
-
JENKINS-50036 User id is forced when using dockerfile in pipeline
- Open