Status: Closed (View Workflow)
* jenkins/jenkins:2.75 image
* kubernetes-pipeline plugin 0.12
* docker-workflow plugin 1.12
* docker-commons plugin 1.8
* durable-task-plugin 1.14
It seems to be impossible to use Docker Pipeline plugin when inside a Kubernetes-provided node (which is in fact a Kubernetes Pod).
Steps to reproduce:
- run minikube
- checkout kubernetes-plugin repo
- run jenkins from the manifests in the aforementioned repo
- install plugins listed in the "Environment" section
- create a "pipeline" job
- connect a git repo to the job
- create Jenkinsfile (as in the example below)
- run a job build
The error message:
I did some debugging with docker-commons and docker-workflow plugins (adding some custom log messages) and it looks like the stdout is not getting through from hudson.Launcher to docker-commons (as can be seen in the above stack trace, there isn't anything after "but got"). The same functionaliy (app = docker.build("whatever")) works when it isn't run from inside Kubernetes (via kubernetes-plugin).
More debugging has led me to durable-task-plugin which seems to be responsible for swallowing the stdout and stderr streams.
Actually, I've even modified the code launching appropriate "docker inspect" command in docker-workflow plugin to run "hostname" instead and its stdout is also not getting through to the calling process, so the problem does not seem to be related to dind in any way.
Note that the commented-out code in my Jenkinsfile works fine, i.e. I'm able to build the image "by hand", but I'm aiming to use both the plugins (kubernetes-plugin and docker-workflow-plugin aka docker-pipeline-plugin) together.
Right before the stacktrace, I was seeing the "SEVERE: onClose called but latch already finished. This indicates a bug in the kubernetes-plugin" message in the log, so I though it might be related to https://issues.jenkins-ci.org/browse/JENKINS-45885 and fixed in https://github.com/jenkinsci/kubernetes-plugin/pull/182, so I tried to use a snapshot built from master, but to no effect – stil getting the same stracktrace.
(Previously filed as a comment to