Using existing composed docker containers in Jenkins pipeline

Is there a way with the docker pipeline plugin to do operations inside of an existing container?  Here's what I mean:  I have two docker images that I build and then link together using a compose file.   I'd then like to pass that container id to something like withDockerContainer  or the docker global variable and have it run shell commands inside the container. 

Right now, it seems like the "withDockerContainer" function only takes one image id and spins up a new container from that.  That doesn't work for my case because the container I want to use is actually composed from multiple images. 

So I either need to be able to pass an existing container that I've already composed or tell the docker variable to do the compose for me when it spins up a new container.    (And yes, I know I can do this with sh steps, but seems like something we should be able to do with the functionality from the Docker Pipeline Plugin.)



Please sign in to leave a comment.