Skip to content

Commit

Permalink
docker clean script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Gagis committed Feb 29, 2024
1 parent 5b6f7f3 commit 61d33b2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/myci-docker-clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# we want exit immediately if any command fails and we want error in piped commands to be preserved
set -eo pipefail

echo "remove stopped containers"
docker container prune --force
echo ""

echo "remove unused volumes"
docker volume prune --all --force
echo ""

echo "remove dangling images"
docker image prune --force

0 comments on commit 61d33b2

Please sign in to comment.