mirror of
https://github.com/dokku/dokku.git
synced 2025-12-28 16:06:40 +01:00
Merge pull request #121 from alexanderbeletsky/cleanup
issue #120 add step to clean up all dead instances and none used images
This commit is contained in:
11
dokku
11
dokku
@@ -12,6 +12,10 @@ case "$1" in
|
||||
echo "-----> Release complete!"
|
||||
echo "-----> Deploying $APP ..."
|
||||
dokku deploy $APP $IMAGE
|
||||
echo "-----> Deploy complete!"
|
||||
echo "-----> Cleaning up ..."
|
||||
dokku cleanup
|
||||
echo "-----> Cleanup complete!"
|
||||
echo "=====> Application deployed:"
|
||||
echo " $(dokku url $APP)"
|
||||
echo
|
||||
@@ -58,6 +62,13 @@ case "$1" in
|
||||
pluginhook post-deploy $APP $port
|
||||
;;
|
||||
|
||||
cleanup)
|
||||
# delete all non-running container
|
||||
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm 2> /dev/null &
|
||||
# delete unused images
|
||||
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi 2> /dev/null &
|
||||
;;
|
||||
|
||||
plugins)
|
||||
ls -1 -d $PLUGIN_PATH/*/
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user