docker - Sharing data-volume for shared maven repository -
i have multiple maven projects, of on dependend on other. projects being build in dedicated build-image , being build via jenkins.
my plan have shared data volume contains maven repository folder, in dependecies should stored , own dependency should installed in.
unfortunatly alread fails while building dependency. reference, jenkinsfile:
node { stage ('initializing') { checkout scm } stage ('build artifact') { sh 'docker build -f="dockerfile" -t build-image .' sh 'docker create --name build-james-plugin-interface --volume m2-repo:/root/.m2 build-image' sh 'docker rm build-james-plugin-interface' } }
and dockerfile of build-image:
from qnerd/rpi-maven env build_home=/usr/local/james/ run mkdir -p $build_home workdir $build_home add pom.xml $build_home # add source add . $build_home # run maven verify entrypoint ["mvn","clean","install"]
the folder of data volume stays empty whole time, there's error in files.
i hope can me.
the problem creating container of build-image , deleting it. create doesn't run container, creates it. either use
sh 'docker run --name build-james-plugin-interface --volume m2-repo:/root/.m2 build-image'
or add
sh 'docker start build-james-plugin-interface'
after create command.
Comments
Post a Comment