I'm writing a Jenkinsfile to create builds for a multi-branch pipeline and docker/docker pipeline plugin for spinning up the docker containers in Jenkins. I have an image that I want to use to build the docker containers. I need to pull this image from a certain URL say: docker.abc.com
, run the container and then do all the Jenkins stuff inside the container. I'm currently getting the following error:
Jenkins does not seem to be running inside a container
My code looks something like this:
node {
try {
// set working directory
dir(working directory here){
stage(main){
checkout scm
docker.image("docker.abc.com/def:latest").inside{
// do Jenkins stuff
}
}
}
}
catch {
// catch error and send notification
}
}