Skip to content

Commit d766be5

Browse files
jose-bigiopsftw
authored andcommitted
Remove containers instead of images
Signed-off-by: jose-bigio <[email protected]>
1 parent c383197 commit d766be5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vars/wrappedNode.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def call(Map vars, Closure body=null) {
99
// or is misconfigured, these operations will fail and the exception will be
1010
// propogated.
1111
withChownWorkspace { echo "cleanWorkspace: Ensuring workspace is owned by ${env.USER}" }
12-
echo "Removing all docker images"
13-
sh("for image in \$(docker ps -aq); do docker rm -f \$image; done")
14-
echo "Docker images have been removed"
12+
echo "Removing all docker containers"
13+
sh("for cid in \$(docker ls -aq); do docker container rm -vf \$cid; done")
14+
echo "Docker containers have been removed"
1515

1616
echo "cleanWorkspace: Removing existing workspace"
1717
deleteDir()

0 commit comments

Comments
 (0)