This commit is contained in:
Lihan 2024-07-27 15:21:40 -04:00
parent 53ef24191b
commit d0bfd8b78e

4
Jenkinsfile vendored
View file

@ -37,10 +37,10 @@ pipeline {
post { post {
always { always {
script { script {
// Use the saved Docker image ID from the environment if needed
if (env.DOCKER_IMAGE_ID) { if (env.DOCKER_IMAGE_ID) {
echo "Stopping and removing Docker Image with ID: ${env.DOCKER_IMAGE_ID}" echo "Stopping and removing Docker Image with ID: ${env.DOCKER_IMAGE_ID}"
docker.rmi(env.DOCKER_IMAGE_ID) // Using shell command to remove Docker image
sh "docker rmi ${env.DOCKER_IMAGE_ID}"
} }
} }
} }