Here we have prepared a list of commands that may be useful to you on Docker.

Useful commands for Docker

To check the currently installed version of docker

docker --version

List your images.

$ docker image ls

Delete a specific image.

$ docker image rm [image name]

Delete all existing images.

$ docker image rm $(docker images -a -q)

List all existing containers (running and not running).

$ docker container ls  (will list only running container)
$ docker container ls -a (will list all containers)

Start existing container.

docker container start [container-id/Name]

Stop a specific container.

$ docker stop [container-id/Name]

Stop all running containers.

$ docker stop $(docker ps -a -q)

Delete a specific container (only if stopped).

$ docker rm [container name]

Delete all containers (only if stopped).

$ docker rm $(docker ps -a -q)

Display logs of a container.

$ docker logs [container name]

Remove Unused container

docker container prune

Remove Unused images

$ docker image prune

Clean work system

docker system prune -a

Also read, Getting Started With Docker: A Beginners Guide

Topics covered:

Found this article helpful?

TutsCoder tutorials are free and ad-light — supported by readers like you. Buy me a coffee (or two ☕☕) as a token of appreciation and help keep Angular & Node.js content coming!

One-time. No subscription. 100% optional. 🙏 Every coffee counts!

Leave a Comment

Your email will not be published. Spam-free zone. ✌️

Available for Projects

Need Help With Your
Angular or Node.js Project?

7+ years of MEAN Stack experience. I build scalable Angular 21 apps, Node.js APIs, and SaaS products — delivered on time, every time.

7+ Years MEAN Stack Angular 21 + Nx Expert 20+ Projects Delivered Remote / Freelance