Jenkins pipeline build in docker

  docker, jenkins, pipeline

We are trying to build multiple steps in Docker in Jenkins, but in console have this error:

jnlp-agent-pod-lwhwx seems to be running inside container 78f6224d8b5a34f5b709e354b1649abc4529f221a949725f8...
but /home/jenkins/workspace/my-pipeline could not be found among []
but /home/jenkins/workspace/[email protected] could not be found among []
$ docker run -t -d -u 1000:1000 -w /home/jenkins/workspace/my-pipeline -v /home/jenkins/workspace/my-pipeline:/home/jenkins/workspace/my-pipeline:rw,z -v /home/jenkins/workspace/[email protected]:/home/jenkins/workspace/[email protected]:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** node:14-alpine cat
$ docker top 4318a8d32d14fd27c706daa677ba9b663fd986d3b7923fee166f6 -eo pid,comm
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build Back End)
[Pipeline] sh
process apparently never started in /home/jenkins/workspace/[email protected]/durable-36b64c56

The script file looks like this:

pipeline {
    agent {
        docker { image 'node:14-alpine' }
    }
    stages {

        stage('Build Back End') {
            steps {
                sh '''
                    git clone https://github.../mygit.git
                '''
            }
        }
}

does it mean my project is not in docker or how we can fix this?

Previously if we just used agent any, there were no such errors, so probably something related to docker.

Source: Docker Questions

LEAVE A COMMENT