Skip to main content

Command Palette

Search for a command to run...

Understanding <docker> commands made simple!

Understand the <action> <noun> pattern — and never Google basic Docker commands again.

Updated
2 min read
Understanding <docker> commands made simple!
J
Passionate and results-driven Senior Software Engineer with over 7 years of experience building scalable backend systems, designing cloud-native architectures, and automating deployments. Specialized in Python, AWS cloud services, k8s, Docker, Golang, GitHub Actions with a strong focus on performance, security, and reliability.

It’s difficult when it comes to remembering all the docker commands.
Every time, Googling, and copying the commands — which takes quite a bit of time.
So, I’m going to share what I did to master the docker commands.

I understood the structure and how commands is being formed.

Docker Command Pattern

Almost every Docker command follows this structure:

docker <action> <noun>

Where:

  • Action = what you want to do (run, build, start, stop, etc.)

  • Noun = what you want to do it to (container, image, volume, network)

Common Examples

Action (verb)Noun (object)Example commandMeaning
runimagedocker run nginxRun a container from the nginx image
buildimagedocker build -t myapp .Build an image from a Dockerfile
pullimagedocker pull ubuntuDownload an image from Docker Hub
pushimagedocker push myappUpload image to Docker registry
pscontainersdocker ps -aList all running/stopped containers
startcontainerdocker start myappStart a stopped container
stopcontainerdocker stop myappStop a running container
rmcontainerdocker rm myappRemove a container
rmiimagedocker rmi myappRemove an image
execcontainerdocker exec -it myapp bashRun a command inside a running container
logscontainerdocker logs myappShow container logs
volume(noun itself)docker volume lsManage persistent storage
network(noun itself)docker network lsManage container networking

Tips

  • Understand the fundamentals

  • Get Your Hands Dirty!