Windows
docker rmi $(docker images -q -f dangling=true)
Linux
docker rmi $(docker images -q -f dangling=true)
Windows
docker stop $(docker ps -q)
Linux
docker stop $(docker ps -q)
Windows
docker rm $(docker ps -a -q)
Linux
docker rm $(docker ps -a -q)
Windows
docker rm -f $(docker ps -a -q)
Linux
docker rm -f $(docker ps -a -q)
Linux
docker service rm $(docker service ls -q)
Windows
docker rmi $(docker images -q)
Linux
docker rmi $(docker images -q)
Windows
docker exec -it $(docker ps -a --format '{{.Names}}' | grep 'substring_of_container_name' | head -n 1) /bin/sh
Linux
docker exec -it $(docker ps -a --format '{{.Names}}' | grep 'substring_of_container_name' | head -n 1) /bin/sh
Windows
docker ps -a --format "{{.Names}}" | Where-Object { $_ -like "*somestringincontainername*" } | ForEach-Object { docker stop $_; docker rm $_ };
Linux
docker ps -a --format "{{.Names}}" | grep 'somestringincontainername' | while read name; do docker stop "$name"; docker rm "$name"; done
Windows
docker images --format "{{.Repository}}:{{.Tag}}" | Where-Object { $_ -like "*somestringincontainername*" } | ForEach-Object { docker rmi $_ }
Linux
docker images --format "{{.Repository}}:{{.Tag}}" | grep 'somestringincontainername' | while read image; do docker rmi "$image"; done