i've my windows 10 machine with docker and jenkins for windows and i'm trying to create a jenkins job usign pipelines where i want ro run a build inside a docker container, and for some reason when i start the build it always result in the same following error:
java.io.IOException: Failed to run image 'myimage:tag'. Error: docker: Error response from daemon: the working directory 'D:/jenkins/workspace/jobname@2/' is invalid, it needs to be an absolute path.
before the error occours, i see that is trying to run with the following command automatically
Jenkins does not seem to be running inside a container
$ docker run -d -t -w D:/jenkins/workspace/jobname@2/ -v D:/jenkins/workspace/jobname@2/:D:/jenkins/workspace/jobname@2/ -v D:/jenkins/workspace/jobname@2@tmp/:D:/jenkins/workspace/jobname@2@tmp/ -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ********...
My jenkinsfile is as simple as this
pipeline {
agent any
stages {
stage('Build') {
agent {
docker {
image 'myimage:tag'
}
}
steps {
sh 'ls -lha'
}
}
}
}
What can i do to solve this issue? any ideas?