Skip to content

Instantly share code, notes, and snippets.

@gte445e
Created May 28, 2017 19:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gte445e/85119eb6e93bd46fb2bbd3e3a362ce68 to your computer and use it in GitHub Desktop.
Save gte445e/85119eb6e93bd46fb2bbd3e3a362ce68 to your computer and use it in GitHub Desktop.
Docker Pull/Update Images using PowerShell
# Pull all images
docker images --format "{{.Repository}}" | %{docker pull $_}
@sjbrouillard
Copy link

sjbrouillard commented Nov 15, 2017

Thanks for a great little gist. It's extremely helpful for cleanup.

I have one very small suggestion - pipe it through Where-Object to eliminate any dangling/intermediate images that might be hanging out from an attempted pull. Not a huge deal, just a small, incremental improvement, I think.

docker images --format "{{.Repository}}" | Where-Object {$_ -ne "<none>"} | %{docker pull $_}

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