-
Bug
-
Resolution: Duplicate
-
Minor
-
None
My Jenkins is within a Docker container, and I try to run docker.build(...).inside(...) in it, but the inside bit does not run within the newly built container. I know, because pwd gives me: /var/jenkins_home/workspace/youtube-delete-tracker_jenkins which is clearly the Jenkins container.
I've tried this both in imperative and declarative style.
I have a lot more details in a StackOverflow question: https://stackoverflow.com/questions/53950128/jenkins-within-docker-dockerfile-agent-happens-outside-new-container
- duplicates
-
JENKINS-33510 dir('foo') inside "docker.image().inside{}" does not affect CWD of launched processes
-
- Resolved
-
- relates to
-
JENKINS-52493 Declarative: Steps don't run inside container with "dockerfile true"
-
- Open
-
Closing this issue in favor of
JENKINS-33510.It turns out that I only thought that that the commands were run on the host, but what I didn't know was that Jenkins mounted the exact same folder for the job into the container and cd'd into it for me (which I didn't expect nor want).