Is it possible to use absolute paths for the workspace at the time the
docker container is being created/run with declarative pipeline? I have
done this before with mesos docker cloud, but I am hoping to replicate that
ability locally, without having a mesos cluster on my localhost.
An example pipeline:
pipeline {
agent none
stages {
stage('Foo') {
agent {
docker {
label 'dind'
image 'alpine'
*customWorkspace '/foo'*
}
}
But when I try this, I end up with the results:
sh: can't create /foo@tmp/durable-5a40a590/jenkins-log.txt: nonexistent
directory
sh: can't create /foo@tmp/durable-5a40a590/jenkins-result.txt.tmp: nonexistent
directory
mv: can't rename '/foo@tmp/durable-5a40a590/jenkins-result.txt.tmp': No such
file or directory
This post leads me to believe it may not be possible:
https://github.com/jenkinsci/docker-plugin/issues/540
This post leads me to believe it may be possible:
https://groups.google.com/d/msg/jenkinsci-users/_YNnkdYRXoE/4LifSIOoAAAJ,
but that I haven't figured out the right combination of volumes and
containers.
I am using docker-compose to create my environment. Can recreate locally
from this branch:
https://github.com/NeverOddOrEven/dind-jenkins/commits/custom-ws-dind-agent-not-working.
Any help would be truly appreciated! Thanks.
--
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/01044517-cbf6-4dbb-9b45-17516a903b9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.