-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a69d10
Showing
4 changed files
with
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# OS X files | ||
.AppleDB/ | ||
.AppleDesktop/ | ||
.AppleDouble/ | ||
.DocumentRevisions-V100/ | ||
.fseventsd/ | ||
.Spotlight-V100/ | ||
.TemporaryItems/ | ||
.Trashes/ | ||
Network Trash Folder/ | ||
Temporary Items/ | ||
._* | ||
.apdisk | ||
.com.apple.timemachine.donotpresent | ||
.DS_Store | ||
.LSOverride | ||
.VolumeIcon.icns | ||
# Icon must end with two carriage returns (\r) | ||
Icon | ||
|
||
# Windows files | ||
$RECYCLE.BIN/ | ||
Desktop.ini | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Vim files | ||
*~ | ||
*.swp | ||
|
||
# vim: syntax=conf cc=80 tw=79 ts=4 sw=4 sts=4 et sr | ||
|
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Francesco Falanga | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,23 @@ | ||
# SDED | ||
|
||
SDED (Stop Docker eating disk space) is a mini superset of the docker command that help to cleanup disk space eat by docker. | ||
|
||
`sded.sh` is a simple bash script. | ||
|
||
## Shorcuts | ||
|
||
```bash | ||
h: show this help text | ||
l: see list of running containers | ||
i: see list of stored images | ||
od: delete orphaned and dangling volumes | ||
du: delete dangling and untagged images | ||
``` | ||
|
||
## Installation | ||
|
||
Copy `sded.sh` in your usr/local/bin directory. | ||
|
||
## How to contribute | ||
|
||
Have an idea? Found a bug? Contributions are more than welcome! |
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,50 @@ | ||
#!/usr/bin/env bash | ||
# Mini superset of the docker command that help to cleanup disk space eat by docker | ||
|
||
# Traps any error (see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) | ||
set -e -o pipefail -u | ||
|
||
dkrshelp () { | ||
cat <<EOT | ||
Usage: $(basename "$0") [h] [l,i,od,du] -- cleanup disk space eat by docker | ||
where: | ||
h: show this help text | ||
l: see list of running containers | ||
i: see list of stored images | ||
od: delete orphaned and dangling volumes | ||
du: delete dangling and untagged images | ||
EOT | ||
exit 0 | ||
} | ||
|
||
argc=${#} | ||
if [[ ${argc} -eq 0 ]]; then | ||
dkrshelp | ||
fi | ||
|
||
cmd=${1} | ||
|
||
case ${cmd} in | ||
h) | ||
dkrshelp | ||
;; | ||
-h) | ||
dkrshelp | ||
;; | ||
l) | ||
docker ps | ||
;; | ||
i) | ||
docker images | ||
;; | ||
od) | ||
docker volume rm $(docker volume ls -qf dangling=true) | ||
;; | ||
du) | ||
docker rmi $(docker images -q -f dangling=true) | ||
;; | ||
*) | ||
dkrshelp | ||
;; | ||
esac |