如何在Jenkinspipe道中使用嵌套的docker.image('test_image')。inside()

我有一个jenkins容器,它触发一个maven容器来构build一个java代码。 现在我想用seleniumtesting相同的代码。 我有另一个selenium服务器的容器。 但是使用selenium运行testing的命令是需要Maven的mvn命令。 因为我在selenium容器内执行这个,mvn不被识别。 我如何使用selenium容器内的Maven容器? 是否可以嵌套? 我不想在同一个容器中安装所有的东西。 这是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 } } } 

我可以使用“docker.image('mvn_custom_image')。inside”在另一个容器(在我的情况下,selenium)?

或者有其他类似的结果。