sonic-buildimage/.azure-pipelines/template-clean-sonic-slave.yml
Qi Luo 3fa538e58c
Revert "[ci] Set default ACR in UpgrateVersion/PR/official pipeline. (#10341)" (#10535)
This reverts commit f4bbcd1cf1. The original one was missing one file ".azure-pipelines/azure-pipelines-repd-build-variables.yml" and break the Azure pipeline.
2022-04-11 23:53:42 -07:00

9 lines
376 B
YAML

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