(The below are using the recomended commands although docker ps <options> would be identicle for now)
- All containers:
docker container ls -a - Running containers:
docker container ls(docker psis the exact same, but is no longer the recomended command) - All stopped containers:
docker container ls -f "status=exited" - IDs of running containers:
docker container ls -q - IDs of all containers:
docker container ls -aq - Recently created containers:
docker container ls -l
- Kill all containers:
docker container kill $(docker container ls -q) - Kill specific container
docker container kill <container name or ID> - Stop specific container
docker container stop <container name or ID> - Stop all containers
docker container stop $(docker container ls -q)
- Remove one or more containers:
docker container rm <container name(s) or container ID(s)> - Remove all containers
docker container rm $(docker container ls -aq)
- List all images
docker image ls -a - IDs of all images
docker image la -aq
- Remove dangling images:
docker image prune - Remove one or more images:
docker image rm <image name(s) or ID(s)> - Remove all images:
docker image rm $(docker image ls -aq)
Search by GitHub