DEV Community

Cover image for Command to list docker containers
Adrian Matei for Codever

Posted on • Edited on • Originally published at codever.dev

2 1

Command to list docker containers

To list the docker running containers use the following command:

docker ps
Enter fullscreen mode Exit fullscreen mode

To show all running containers use the -a (--all) option:

docker ps -a
Enter fullscreen mode Exit fullscreen mode

If you want to filter, by name for example you can use the --filter option with the name=containing_text value

$ docker ps --filter "name=codever"
8a01ae8ef526   jboss/keycloak:6.0.1   "/opt/jboss/tools/do…"   3 days ago      Exited (255) 10 hours ago   0.0.0.0:8480->8080/tcp     codever-keycloak
f7c51c81dc4f   mongo:3.4              "docker-entrypoint.s…"   3 days ago      Exited (255) 10 hours ago   0.0.0.0:27017->27017/tcp   codever-mongo
5b2f88b9fe57   postgres               "docker-entrypoint.s…"   3 days ago      Exited (255) 10 hours ago   5432/tcp                   codever-postgres
Enter fullscreen mode Exit fullscreen mode

You could also obtain similar results if piping the docker ps command to grep - docker ps -a | grep codever


Reference -

https://docs.docker.com/engine/reference/commandline/ps/


Shared with ❤️ from Codever. Use 👉 copy to mine functionality to add it to your personal snippets collection.

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay