-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Taken from https://github.com/gnarea/shell-tools/blob/aef8f5cde2966b93fe4eda27d57769b544862546/docker-clean As the original author, I am relicensing this work under the BSD License. INF-97
- Loading branch information
Gustavo Narea
committed
Jul 27, 2017
1 parent
b19a54c
commit 3e3ee19
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
############################################################################## | ||
# | ||
# Copyright (c) 2017, 2degrees Limited. | ||
# Copyright (c) 2017, Gustavo Narea. | ||
# | ||
# This file is part of docker-dev | ||
# <https://github.com/2degrees/docker-dev>, which is subject | ||
# to the provisions of the BSD at | ||
# <http://dev.2degreesnetwork.com/p/2degrees-license.html>. A copy of the | ||
# license should accompany this distribution. THIS SOFTWARE IS PROVIDED "AS IS" | ||
# AND ANY AND ALL EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT | ||
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST | ||
# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
############################################################################## | ||
. "$(dirname $BASH_SOURCE)/_bootstrap.sh" | ||
|
||
|
||
docker ps --quiet --all | \ | ||
xargs --no-run-if-empty docker rm --force --volumes >> /dev/null | ||
|
||
docker system prune --force | ||
|
||
docker images | egrep '(weeks|months|years) ago' | awk '{ print $3 }' | \ | ||
xargs --no-run-if-empty docker rmi --force >> /dev/null |