Cloudbees Docker.inside与-v?

我希望安全地login到docker卷中,以便在我的apitests失败时访问日志。

提供docker.inside命令的Cloudbees插件(或者在我的情况下是apitestimage.inside)似乎没有使用-v参数。

任何帮助如何安装该卷?

(顺便说一句:我做了一个

docker volume create apitestvolume 

在主机上)

 stage('build Dockerimage and run API-tests') { steps{ script { def apitestimage = docker.build('apitestimage', '--no-cache=true dockerbuild') apitestimage.inside('-p 5800:5800', '-v apitestvolume:/apitestvolume') { dir('testing'){ sh 'ctest -V' } } } } post { success { sh 'docker rmi --force apitestimage' } failure { script{ apitestimage.inside() { sh 'cp /testing/settings/program/logs/* /apitestvolume' } } } } } } }