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:
docker psShows only running containers.
Want to See All Containers, Even Stopped Ones?
docker ps -aNow 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?
docker ps --latestGreat for checking if the most recently created container is working properly.
How to Check How Much Space a Container is Using?
docker ps -sThis helps when your disk space is running low. ๐งน
How to See Only Container IDs?
docker ps -qUseful 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:
docker ps --filter label=app=my-app๐ Show containers created before a specific one:
docker ps --filter before=my-app-container๐ Find containers using a specific volume:
docker ps --filter volume=my-volume๐ See containers in a specific network:
docker ps --filter network=my-networkHow to Change docker ps Output?
By default, docker ps outputs a table, but you can customize what is displayed:
docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}'This will show only the container ID, image, and status.
Want JSON format? Easy:
docker ps --format jsonPro 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โre building things, breaking things, or just trying to keep your digital life a little calmer - these are tools I actually use every day:
๐ธ Proton VPN (60% off link) - my invisible cloak online. It secures your Wi-Fi, hides your IP, and blocks trackers - even on the sketchiest cafรฉ Wi-Fi.
๐ Proton Pass (50% off link) - my password vault. On-device encryption for logins, 2FA, and notes - all mine and only mine.
๐ฆ GitKraken Pro (50% off link) - my visual Git sidekick. Gorgeous commit graph, painless merges, and fewer โwhat just broke?โ moments.
๐ These links give you sweet discounts - and help support DevOps.Pink at no extra cost. Thanks a ton!
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.