Skip to content

Instantly share code, notes, and snippets.

@marek-pietrzak-tg
Created August 8, 2016 11:49
Show Gist options
  • Select an option

  • Save marek-pietrzak-tg/e5890e7736d14197643b2a641b6c4db7 to your computer and use it in GitHub Desktop.

Select an option

Save marek-pietrzak-tg/e5890e7736d14197643b2a641b6c4db7 to your computer and use it in GitHub Desktop.
Docker containers "clean up"
#!/bin/sh
# You can "clean-up" your containers by.
# 1. Removing the exisiting, non-running, containers (will delete their data too if they are not running):
docker rm $(docker ps -qa)
# 2. Removing the existing, unused, images:
docker rmi $(docker images -q)
# and docker volumes:
docker volume rm $(docker volume ls -q)
@marek-pietrzak-tg

Copy link
Copy Markdown
Author
docker system prune -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment