-
-
Save jrgcubano/92ed975fb41efede2ccd1fb5a3848bc9 to your computer and use it in GitHub Desktop.
Docker Cleanup
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
(& docker images --all --quiet --filter 'dangling=true') | Foreach-Object { | |
& docker rmi $_ | out-null | |
} | |
(& docker ps --quiet --filter 'status=exited' ) | Foreach-Object { | |
& docker rm $_ | out-null | |
} |
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
_images=$(docker images --all --quiet --filter 'dangling=true') | |
[[ -z ${_images// } ]] || docker rmi $_images | |
_containers=$(docker ps --quiet --filter 'status=exited') | |
[[ -z ${_containers// } ]] || docker rm $_containers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment