Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Powershell Docker commands and useful one-liners
# Get list of all untagged images with no repository set
docker images --format "{{.ID}}--{{.Repository}}--{{.Tag}}" | Where { $_ -match "<none>--<none>" } | % { $_.Split("--")[0] }
# Remove all untagged / no repository docker images
docker images --format "{{.ID}}--{{.Repository}}--{{.Tag}}" | Where { $_ -match "<none>--<none>" } | % { $_.Split("--")[0] } | % { docker rmi $_ }
# Remove all stopped containers
docker ps -a -q | % { docker rm $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.