Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Last active September 1, 2023 01:28
Show Gist options
  • Save michaellwest/e237b23367e54452a5d915ec7e8253f5 to your computer and use it in GitHub Desktop.
Save michaellwest/e237b23367e54452a5d915ec7e8253f5 to your computer and use it in GitHub Desktop.
A convenient PowerShell script to list all the docker images and pull the from the registry.
docker image ls --format "{{json .Repository}},{{json .Tag}},{{json .ID}}" |
ConvertFrom-Csv -Header "Repository","Tag","Id" |
Where-Object { $_.Tag -ne "<none>" -and $_.Repository.Contains("/") } |
ForEach-Object { docker pull "$($_.Repository):$($_.Tag)"}
@michaellwest
Copy link
Author

Cleanup the unused layers after pulling the latest images.

docker image prune

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment