Last active
November 7, 2018 16:10
-
-
Save Shogan/9a0bf97ea15db67cf0a6e088002e290a to your computer and use it in GitHub Desktop.
Powershell Docker commands and useful one-liners
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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