I have a jenkins container which triggers a maven container to build a java code. Now I want to test the same code with selenium. I have another container for selenium server. But the command to run the test using selenium is a mvn command which needs Maven. Since I am executing this inside the selenium container, mvn is not recognized. How can I use maven container inside the selenium container ? Is nesting possible ? I don't want to install everything in the same container. This is the Jenkinsfile :
node {
stage('checkout') {
git credentialsId: 'Gitlab_cred', url: 'urlhere'
}
stage('Build') {
docker.image('mvn_custom_image').inside('-u root'){
//mvn commands to build the project
}
}
stage('Archive and Packaging') {
archiveArtifacts '**/*.war'
}
stage('Integration Test') {
docker.image('selenium/node-firefox:3.4.0-dysprosium').inside{
//I want to run mvn command using selenium here
// This image doesn't have mvn
}
}
}
Can I use "docker.image('mvn_custom_image').inside" inside another container (in my case selenium) ?
Or any other way which has a similar result.