diff --git a/.azure-pipelines/template-clean-sonic-slave.yml b/.azure-pipelines/template-clean-sonic-slave.yml index cc995e9c2621..c67f63fff476 100644 --- a/.azure-pipelines/template-clean-sonic-slave.yml +++ b/.azure-pipelines/template-clean-sonic-slave.yml @@ -1,7 +1,7 @@ steps: - script: | containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') - [ -n "$containers" ] && docker container rm -f containers + [ -n "$containers" ] && docker container rm -f $containers docker images | grep "^" | awk '{print$3}' | xargs -i docker rmi {} images=$(docker images 'sonic-slave-*' -a -q) [ -n "$images" ] && docker rmi -f $images