Created
April 29, 2019 12:45
-
-
Save matinrco/6886dbafeed95eedfd6cfc7c6b0cf147 to your computer and use it in GitHub Desktop.
Update all docker images then remove all untagged images
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
#!/bin/zsh | |
#################################################### | |
## Notice : use for development environment only. ## | |
#################################################### | |
#Update all images | |
docker images --format "{{.Repository}}:{{.Tag}}" | grep -v "<none>" | xargs -L1 docker pull | |
#Remove all untagged images | |
docker rmi $(docker images | grep "<none>" | awk '{print $3}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment