pipeline { agent any stages { stage('Build') { steps { sh 'docker build --pull -t workout:jenkins .' } } stage('test') { steps { sh 'docker stop pg' sh 'docker run --rm --name pg -d postgres' sh 'docker image ls' } } } post { always { sh 'docker stop pg' } } }