docker ps --filter volume=VOLUME_NAME
container doc
-
docker container ls
- flags:
-a
: all containers
- flags:
-
all status exited
docker ps --filter "status=exited
docker image ls
- all containers
docker container rm $(docker container ls -aq)
- all images
docker image rm $(docker image ls -aq)
- all volumes
docker volume rm $(docker volume ls -q)
docker rm CONTAINER_NAME: delete the container to free disk space
docker rmi IMAGE_NAME:TAG: remove image from your computer to free disk space
docker run -d -p 27017:27017 -v data:/data/db mongo
-d: development -v: version
docker start CONTAINER_NAME
docker stop CONTAINER_NAME
- stop all
docker container stop $(docker container ls -aq)
- kill all running containers with
docker kill $(docker ps -q)
- delete all stopped containers with
docker rm $(docker ps -a -q)
- delete all images with
docker rmi $(docker images -q)
- date and stop a container that is in a crash-loop with
docker update --restart=no && docker stop
- sh shell into container
docker exec -i -t /bin/bash
- if bash is not available use/bin/sh
- sh shell with root if container is running in a different user context
docker exec -i -t -u root /bin/bash