Some progress thanks to Jesse Glick.

Answer: you have to fill the "Docker Command” field under "Docker Agent 
templates” (under “Cloud”). I assume that by default Jenkins is passing 
the  —rm options when executing the docker command and this is why we need 
an override.

It works but but strangely I don’t see the workspace in the container even 
though the pipeline logs says it’s in /root/workspace. Maybe some mounts 
are done for the workspace by default (even though I didn't pass any mount 
in my command)?

FTR the command I've used is "docker run -v 
/var/run/docker.sock:/var/run/docker.sock xwiki/xwiki-jenkins-slave”

Any idea?

Thanks
-Vincent


Le lundi 4 février 2019 13:45:47 UTC+1, Vincent Massol a écrit :
>
> Hi Jenkins users/devs,
>
> I'm testing Jenkins with agents spawned as docker containers (I have my 
> own custom docker image built on top of "jenkins/ssh-slave").
>
> However, one important is when a job fails and I need to debug it, since 
> by default the spawned docker container is removed when the job finishes.
>
> I couldn't find any option in the jenkins system configuration, under 
> "Docker Agent templates" to mention to not remove the container.
>
> Can this be achieved? How do you debug?
>
> Actually I don't need to keep the container per see but I'd need at least 
> to keep the workspace so that I could start a new docker agent on that 
> workspace, if I need to debug a job and reproduce a problem.
>
> Thanks
> -Vincent
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a794402f-1749-4c73-b7f5-82ed33bf1c57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to