0

I am running a very basic Jenkinsfile, docker as agent. Below is the Jenkinsfile.

pipeline{
    agent none
    stages{
        stage('Tomcat version'){
            agent{
                docker {image 'tomcat:jre21-temurin'}
            }
            steps{
                // below ls command showing directories inside the container 
                sh 'ls /usr/local'

                //but below ls and pwd command showing directories present in cuurrent jenkins workspace 
                sh 'ls'
                sh 'pwd'

                //this command runs inside container
                sh 'cat /usr/local/tomcat/RELEASE-NOTES | grep "Apache Tomcat Version"'

                // This command also runs inside container
                sh 'ls /usr/local'
            }
        }
    }
}

In above Jenkinsfile I am seeing very strange behavior as I have explained in every step.

Can someone please helm me to understand, what exactly happening here?

1
  • Any luck? i am having same issue.
    – Tayyab
    Feb 22 at 22:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.