Skip to content

Instantly share code, notes, and snippets.

@steveendow
Created February 12, 2021 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveendow/67d1d9d66b1e268d902aa9ef786b6a08 to your computer and use it in GitHub Desktop.
Save steveendow/67d1d9d66b1e268d902aa9ef786b6a08 to your computer and use it in GitHub Desktop.
PowerShell Script to delete old BC Docker Images Except for base OS image
docker images --format "{{.Repository}}\t{{.Tag}}\t{{.ID}}" |
Select-String "businesscentral" -notMatch |
ConvertFrom-CSV -Delimiter "`t" -Header ("Repository","Tag","ID") |
Sort-Object Tag | % ID | % { docker rmi $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment