Saturday 23 Aug 2025
Docker Commands You Should Know
I have been working with Docker for a while now. I use it to manage my home-lab services. When working with Docker, having the right commands on hand can save you a lot of time and headaches. Whether you're managing containers or accessing them for debugging, here’s a quick guide to some essential Docker commands I have found useful.
- Get Names of Containers
To see all your running containers and their names, use:
docker ps --format "{{.Names}}"
- Start Your App Using Docker Compose
Before you fire up your app, make sure you're in the right directory. Once you're there, simply run:
docker compose up -d
If you've updated your config file and want to reapply the changes, just run the up command again.
- Stop the Containers
To stop all running containers, use:
docker compose down -d
Or, if you only want to stop a single container, run:
docker stop [container_name]
- Accessing a Running Container
Need to get into a running container to troubleshoot or run commands? Here's how you do it:
First, list the running containers:
docker container ls
Get the container ID you need and then:
docker exec -it [container_id] bash
- Show All Docker Images
Want to see a list of all the images you have locally? Run:
docker images
or to get a more detailed list:
docker image ls
Backlinks:
index
Journal:Index
Journal:2025:08