-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: docker-workflow-plugin
Would be very handy to be able to connect to a running container from within a withRun block. I'm thinking it would behave exactly like inside(), except that it would run docker exec to run a command in the container. For example, if you needed to run a Postgres server with an extension installed, you could do it something like this:
script {
image('postgres:10').withRun('-p 5432:5432') { c ->
c.inside {
// Attached to the Postgres container.
sh "apt-get update"
sh "apt-get install hypopg"
}
// Do stuff that relies on Postgres with hypopg
}
}
I would think there would be plenty of use cases for spinning up a container and doing a bit of configuration on it before using a service it provides.