Skip to content

A script that cleans docker containers, images, volumes, and networks.

License

Notifications You must be signed in to change notification settings

trung-huynh/docker-clean

 
 

Repository files navigation

Build StatusGitHub release

Docker-Clean

A simple Shell script to clean up the Docker Daemon.

Requirements

In order to use the volume capabilities, it is required that the Docker Daemon is at least version 1.9+

Install

curl -s https://raw.githubusercontent.com/ZZROTDesign/docker-clean/v1.4.0/docker-clean |
sudo tee /usr/local/bin/docker-clean > /dev/null && \
sudo chmod +x /usr/local/bin/docker-clean

Homebrew Install

brew tap zzrotdesign/tap
brew install docker-clean

Upgrade (for new versions)

brew update && brew upgrade docker-clean

For curl installs, re-running the script above will install the newest version.

Usage

For a more in depth look at the usage and commands run without browsing the script itself check out our USAGE.md.

docker-clean [optional flags below]

Default without arguments deletes stopped containers, dangling volumes, and untagged images.

Options:

-h or --help        Opens this help menu
-v or --version     Prints the current docker-clean version

-a or --all         Stops and removes all Containers, Images, and Restarts docker
-c or --containers  Stops and removes Stopped and Running Containers
-net or --networks  Removes all empty Networks

-i or --images      Stops and removes all Containers and Images
-s or --stop        Stops all running Containers

-l or --log         Adding this as an additional flag will list all
                    image, volume, and container deleting output

-n or --dry-run     Dry run, added at the end to run each command and see
                    the results without removing or stopping anything.

Contributing to Docker-Clean

Team members

Don't hesitate to get in contact with either one of us with problems, questions, etc.

Check out our blog post on why we put this script together.

Adding new features

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request :D

For any new features you hope to see, you can also edit the REQUESTS.md file. https://github.com/ZZROTDesign/docker-clean/blob/master/REQUESTS.md

Don’t get discouraged! We estimate that the response time from the maintainers is around: 24 hours.

License

The code is available under the MIT License.

About

A script that cleans docker containers, images, volumes, and networks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%