Docker Basic Commands - martikainen87/Home-Automation GitHub Wiki
-
docker ps
Check running containers -
docker ps -a
Check all containers -
docker ps -s
Check soze of running containers -
docker ps -as
Check size of all containers -
docker stop nameofcontainer
stopping a container -
docker start nameofcontainer
starting a container -
docker restart nameofcontainer
restarting a container -
docker rm nameofcontainer
!Removes container! -
docker exec -it nameofcontainer bash
lets you "ssh" to the container so you can troubleshoot and other stuff.
-
docker images -a
Check images available -
docker rmi nameofimage
Removes image -
docker inspect --format='{{.Id}} {{.Parent}}' $(docker images --filter since=97256f68a60a -q)
removing any child images to the image specified after "since="
Warning, do not use this if you haven't saved your startup commands and used external storage for configs.
-
docker kill $(docker ps -q)
Kill all running containers -
docker rm $(docker ps -a -q)
Delete all stopped containers (including data-only containers) -
docker rmi $(docker images -q -f dangling=true)
Delete all 'untagged/dangling' () images -
docker rmi $(docker images -q)
Delete ALL images
-
sudo service docker status
check status of docker service -
sudo service docker restart
restarts docker service -
'ncdu' - check storage space