From 8a69d101adf8a9963a7357f6ccca27822e716e63 Mon Sep 17 00:00:00 2001 From: Francesco Falanga Date: Thu, 16 Aug 2018 16:27:56 +0200 Subject: [PATCH] Initial commit --- .gitignore | 32 ++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ sded.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 .gitignore create mode 100755 LICENSE create mode 100755 README.md create mode 100755 sded.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..368eeea --- /dev/null +++ b/.gitignore @@ -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 + diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..9cb5c7b --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100755 index 0000000..70bf406 --- /dev/null +++ b/README.md @@ -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! diff --git a/sded.sh b/sded.sh new file mode 100755 index 0000000..68e474f --- /dev/null +++ b/sded.sh @@ -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 <