File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ docker ps -a -q | ForEach-Object { docker rm -f $_ }
5
5
6
6
docker volume prune -f
7
7
8
- # Preserve the Windows base images and the common eng infra images (e.g. ImageBuilder)
8
+ # Preserve the tagged Windows base images and the common eng infra images (e.g. ImageBuilder)
9
9
# to avoid the expense of having to repull continuously.
10
10
$engInfraImages = Get-Content ./ eng/ common/ templates/ variables/ docker- images.yml |
11
11
Where-Object { $_.Trim () -notlike ' variables:' } |
@@ -14,7 +14,8 @@ $engInfraImages = Get-Content ./eng/common/templates/variables/docker-images.yml
14
14
docker images -- format " {{.Repository}}:{{.Tag}} {{.ID}}" |
15
15
Where-Object {
16
16
$localImage = $_
17
- -Not ($localImage.StartsWith (" mcr.microsoft.com/windows" )`
17
+ $localImage.Contains (" :<none> " )`
18
+ -Or -Not ($localImage.StartsWith (" mcr.microsoft.com/windows" )`
18
19
-Or ($engInfraImages.Where ({ $localImage.StartsWith ($_ ) }, ' First' ).Count -gt 0 )) } |
19
20
ForEach-Object { $_.Split (' ' , [System.StringSplitOptions ]::RemoveEmptyEntries)[1 ] } |
20
21
Select-Object - Unique |
Original file line number Diff line number Diff line change 17
17
continueOnError : true
18
18
- script : >
19
19
docker run --rm $(dockerArmRunOptions) --entrypoint /bin/bash $(dockerClientImage) -c
20
- 'docker rmi -f $(docker images --format "{{.Repository}}:{{.Tag}}" | grep -v -e ^arm32v7/ -e ^arm64v8/ -e ^mcr\\.microsoft\\.com/windows)'
20
+ 'docker rmi -f $(docker images --format "{{.Repository}}:{{.Tag}}" | grep -v -e ^arm32v7/ -e ^arm64v8/ -e ^mcr\\.microsoft\\.com/windows -e :\<none\>$ )'
21
21
displayName: Cleanup Remote Docker Server (images)
22
22
condition: always()
23
23
continueOnError: true
You can’t perform that action at this time.
0 commit comments