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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -