mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #1448 from progrium/josegonzalez-patch-2
Do not delete containers with the label dokku.service
This commit is contained in:
@@ -323,12 +323,12 @@ release_and_deploy() {
|
||||
|
||||
docker_cleanup() {
|
||||
# delete all non-running containers
|
||||
# if a container has the label `dokku`,
|
||||
# if a container has the label `dokku.service`,
|
||||
# then that container is not deleted.
|
||||
# This can be used to mark data containers
|
||||
# as non-removable by the cleanup function
|
||||
# shellcheck disable=SC2046
|
||||
docker rm $(comm <(docker ps -aq -f 'status=exited' | sort) <(docker ps -aq -f 'status=exited' -f 'label=dokku' | sort) -3) &> /dev/null || true
|
||||
docker rm $(comm <(docker ps -aq -f 'status=exited' | sort) <(docker ps -aq -f 'status=exited' -f 'label=dokku.service' | sort) -3) &> /dev/null || true
|
||||
# delete unused images
|
||||
# shellcheck disable=SC2046
|
||||
docker rmi $(docker images -f 'dangling=true' -q) &> /dev/null &
|
||||
|
||||
Reference in New Issue
Block a user