610 words
3 minutes

Docker for Girls - Understanding docker ps Once and For All

Cover image for Docker for Girls - Understanding docker ps Once and For All

Hey girls! ๐Ÿ’–

If youโ€™re as passionate about IT and Docker as I am but sometimes find it a bit complicated, donโ€™t worry! Today, Iโ€™ll explain the super-important docker ps command in a way that anyone can understand! ๐Ÿ˜‰


What is docker ps?#

This command shows all the containers on your computer. It tells you which ones are running, which ones are stopped, and what their settings are. Think of docker ps as your list of all containersโ€”just like a list of open tabs in your browser. ๐Ÿ–ฅ๏ธ


When Should You Use docker ps?#

You use docker ps when you want to:

  • See which containers are currently running.
  • Find out which containers have stopped.
  • Get the ID or name of a container.
  • Check which ports are open.
  • View the size of a container.
  • Check if a container is healthy (yes, containers can have bad days too!).

How to Use docker ps (Examples)#

The Simplest Command:#

Terminal window
docker ps

Shows only running containers.

Want to See All Containers, Even Stopped Ones?#

Terminal window
docker ps -a

Now you can see both running and stopped containers. The STATUS column will show why a container stopped (e.g., due to an error or just being turned off).

How to View the Last Created Container?#

Terminal window
docker ps --latest

Great for checking if the most recently created container is working properly.

How to Check How Much Space a Container is Using?#

Terminal window
docker ps -s

This helps when your disk space is running low. ๐Ÿงน

How to See Only Container IDs?#

Terminal window
docker ps -q

Useful when you need container IDs without extra details.


Filtering docker ps#

To quickly find the container you need, use filters:

๐Ÿ” Find a container with a specific label:

Terminal window
docker ps --filter label=app=my-app

๐Ÿ” Show containers created before a specific one:

Terminal window
docker ps --filter before=my-app-container

๐Ÿ” Find containers using a specific volume:

Terminal window
docker ps --filter volume=my-volume

๐Ÿ” See containers in a specific network:

Terminal window
docker ps --filter network=my-network

How to Change docker ps Output?#

By default, docker ps outputs a table, but you can customize what is displayed:

Terminal window
docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}'

This will show only the container ID, image, and status.

Want JSON format? Easy:

Terminal window
docker ps --format json

Pro Tips!#

โœจ Donโ€™t forget about -a: If a container stops, docker ps wonโ€™t show it by default, so use docker ps -a.
โœจ Set up your favorite commands: For convenience, create aliases for frequently used commands.
โœจ Monitor container sizes: Keep only the necessary containers to avoid wasting disk space.


Conclusion#

The docker ps command is your go-to tool for managing containers. Now you know how to check which containers are running, which have stopped, and how to filter them. Easy, right? ๐Ÿ˜‰

I hope this guide helped! If you have any questions, feel free to askโ€”Iโ€™m always happy to chat about Docker. ๐Ÿ’ป๐Ÿ’–

See you soon, IT girl! ๐Ÿš€


Tools I Personally Trust#

If you want to make your digital life a little calmer - here are two tools I use every day:

๐Ÿ›ธ Proton VPN - A trusted VPN that secures your Wi-Fi, hides your IP, and blocks trackers. Even in that no-password cafรฉ Wi-Fi, youโ€™re safe.

๐Ÿ”‘ Proton Pass - A password manager with on-device encryption. Passwords, logins, 2FA - always with you, and only for you.

These are partner links - you wonโ€™t pay a cent more, but youโ€™ll be supporting DevOps.Pink. Thank you - it really means a lot ๐Ÿ’–


Social Channels#

๐ŸŽฌ YouTube
๐Ÿฆ X (Twitter)
๐ŸŽจ Instagram
๐Ÿ˜ Mastodon
๐Ÿงต Threads
๐ŸŽธ Facebook
๐Ÿฆ‹ Bluesky
๐ŸŽฅ TikTok
๐Ÿ’ป LinkedIn
๐Ÿ“ฃ daily.dev Squad
โœˆ๏ธ Telegram
๐Ÿˆ GitHub


Community of IT Experts#

๐Ÿ‘พ Discord


Refill My Coffee Supplies#

๐Ÿ’– PayPal
๐Ÿ† Patreon
๐Ÿฅค BuyMeaCoffee
๐Ÿช Ko-fi
โšก Telegram Boost


Is this content AI-generated?

Absolutely not! Every article is written by me, driven by a genuine passion for Docker and backed by decades of experience in IT. I do use AI tools to polish grammar and enhance clarity, but the ideas, strategies, and technical insights are entirely my own. While this might occasionally trigger AI detection tools, rest assuredโ€”the knowledge and experience behind the content are 100% real and personal.

Docker for Girls - Understanding docker ps Once and For All
https://www.devops.pink/docker-for-girls-understanding-docker-ps-once-and-for-all/
Author
Tatiana Mikhaleva
Published at
2025-03-07
License
CC BY-NC-SA 4.0