Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 682 Bytes

README.md

File metadata and controls

18 lines (11 loc) · 682 Bytes

DockerSqlCompare

Delete all containers

docker rm $(docker ps -a -q)

Delete all containers not running

docker rm $(docker ps -q --filter "status=exited")

Delete all images

docker rmi $(docker images -q)

Delete all images dangling

docker rmi $(docker images -q --filter "dangling=true")

Rebalancing containers accross all nodes in collection

docker service ls --format "{{.Name}}" | %{$serviceId = $; docker service ps $ -f desired-state=running --format "{{.Node}}" | Group | %{if($.Count -gt 1){Write "Rebalancing $serviceId due to dupplicate containers on same node $";docker service update $serviceId --force --detach=true }} }