Referring to your note below your answer, you can try this simple approach without using plugins:
stage('Building Docker Image') {
# Creating and running the first one
dir ('/path/to/your/directory1') {
sh 'docker build --<docker-options> -t $DOCKER_IMAGE_NAME_1 .'
sh 'docker run $DOCKER_IMAGE_NAME_1'
}
# Creating and running the first one
dir ('/path/to/your/directory2') {
sh 'docker build --<docker-options> -t $DOCKER_IMAGE_NAME_2 .'
sh 'docker run $DOCKER_IMAGE_NAME_2'
}
}
or the same if you are using docker-compose
...
sh 'docker-compose build'
sh 'docker-compose up'
...
Note for your path to the Dockerfile: You are working in jenkins workspace!
There is also a plugin for this as @LinPy mentioned. Have a look at: the Jenkins-Documentation under Using multiple containers.