docker version: 20.10+ - Date: June 2022
Installation
Documentationhttps://docs.docker.com/engine/install/
Show the Docker version / informationdocker version / info
Create a container
Run a containerdocker run [options] IMAGE [COMMAND]
Run a httpd container in backgrounddocker run -d httpd
Manage containers
List running containersdocker ps
List all containersdocker ps -a
Stop a running containerdocker stop CONTAINER
Start a stopped containerdocker start [options] CONTAINER
Remove a containerdocker rm [-f] CONTAINER
Remove all containersdocker rm $(docker ps -a -q)
Manage images
Build an image from a Dockerfiledocker build -t IMAGE[:TAG] .
Search an image on Dockerhubdocker search IMAGE
Pull an image from Dockerhubdocker pull IMAGE[:TAG]
List all local imagesdocker image ls
Remove a local imagedocker image rm IMAGE[:TAG]
Login to a registrydocker login [options] [SERVER]
Pull an image from a registrydocker pull [options] SERVER/NAME[:TAG]
Push an image to a registrydocker push SERVER/NAME[:TAG]
Save container state to a new imagedocker commit CONTAINER IMAGE[:TAG]
Export an imagedocker save -o PATH.tar IMAGE[:TAG]
Import an image
docker load -i PATH.tar