12/04/2026 18:18pm

Docker Commands You Actually Use 90% of the Time as a Developer
#Docker
#Docker Commands
#DevOps
#Docker for Developers
Docker Commands You Actually Use 90% of the Time as a Developer
Why Every Developer Should Embrace Docker
As software development shifts toward DevOps and Microservices architectures, Docker has become an essential tool for developers. Its ability to replicate environments consistently across machines and operating systems effectively eliminates the dreaded "it works on my machine but fails in production" issue.
This article compiles essential Docker commands used daily by Backend Developers, Frontend Developers, Full Stack Engineers, and even QA Engineers. It also covers key concepts such as managing Images, Containers, Volumes, and Networks, along with workflow optimization techniques to dramatically speed up development.
Section 1: Essential Everyday Docker Commands
1. Run a Container from an Image
docker run -d -p 3000:3000 --name myapp node:18- -d: Run in detached mode (in the background)
- -p: Map host ports to container ports
- --name: Assign a name for easy reference
2. View Running Containers
docker ps3. View All Containers (Including Stopped Ones)
docker ps -a4. Stop a Container
docker stop myapp5. Remove a Container
docker rm myapp6. Pull an Image from Docker Hub
docker pull nginx:latest7. List Images on Your Machine
docker images8. Remove Unused Images
docker rmi nginx:latest
Section 2: Pro-Level Docker Techniques for Developers
1. Bind Mount for Real-Time Code Changes
docker run -d -v $(pwd):/app -p 3000:3000 node:18- Perfect for development environments that require hot reloading.
2. Simplify with Docker Compose
# docker-compose.yml
version: '3.8'
services:
web:
image: node:18
ports:
- '3000:3000'
volumes:
- .:/appdocker compose up -d3. View Container Logs
docker logs -f myapp4. Access the Container Shell
docker exec -it myapp shOr, if the container uses a Linux base image:
docker exec -it myapp bash5. Monitor Resource Usage
docker stats
Section 3: Managing Volumes and Networks
1. Create a Volume
docker volume create mydata2. Attach a Volume to a Container
docker run -d -v mydata:/data nginx3. Inspect Volume Details
docker volume inspect mydata4. Create a Custom Network
docker network create mynetwork5. Use a Custom Network with a Container
docker run -d --network=mynetwork --name=db mysql:5.7
Section 4: Pro Tips for Cleaning Up Docker
1. Remove All Stopped Containers
docker container prune2. Remove Unused Images
docker image prune3. Wipe Everything Clean (Use with Caution!)
docker system prune -a
Section 5: Must-Know Daily Docker Commands for Developers
| Task | Command |
|---|---|
| View container IP address | docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' myapp |
| Copy file into a container | docker cp ./localfile.txt myapp:/app/ |
| Copy file out of a container | docker cp myapp:/app/output.txt ./ |
| Check port mapping | docker port myapp |
| Restart a container | docker restart myapp |
Section 6: Docker in Real DevOps Workflows
Integrate Docker with GitLab CI/CD and GitHub Actions
Automatically build and push images to Docker Registry
Write optimized Dockerfiles using Multi-Stage Builds to reduce image size
Conclusion: Docker Isn’t Difficult—Use It Strategically
Docker revolutionizes development by making it more structured, scalable, and predictable—whether for solo projects, team collaborations, or enterprise-grade deployments.
This article compiles 90% of the real-world Docker commands developers use daily, enabling you to work smarter, faster, and more reliably.