[azp]: Fix type in slave container cleanup (#10424)

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
This commit is contained in:
Lawrence Lee 2022-04-01 01:22:54 -07:00 committed by GitHub
parent a9a37c8ba1
commit 0f488a8cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
steps: steps:
- script: | - script: |
containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') 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 "^<none>" | awk '{print$3}' | xargs -i docker rmi {} docker images | grep "^<none>" | awk '{print$3}' | xargs -i docker rmi {}
images=$(docker images 'sonic-slave-*' -a -q) images=$(docker images 'sonic-slave-*' -a -q)
[ -n "$images" ] && docker rmi -f $images [ -n "$images" ] && docker rmi -f $images