How to use the Jenkins docker plugin for containers that persist between stages -


below except jenkins build pipeline script spin container , allow number of actions performed inside container. question this, syntax using docker plugin create container in 1 build stage still can used in subsequent build stages.

    docker.image('groovy:2.4').inside {         sh 'groovy -v'         // if have file called test.groovy in jenkins workspace, can "magically" access         // inside container         sh 'groovy test.groovy'       } 

the inside command causes container exit when body finishes. keep container running use following syntax:

docker.image('image-name').run {    ... } 

this keep container running later stages.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -