View : 0

12/04/2026 18:18pm

Docker Commands You Actually Use 90% of the Time as a Developer

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.

 

Template Blog_11zon.webp

 

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 ps

3. View All Containers (Including Stopped Ones)

docker ps -a

4. Stop a Container

docker stop myapp

5. Remove a Container

docker rm myapp

6. Pull an Image from Docker Hub

docker pull nginx:latest

7. List Images on Your Machine

docker images

8. 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:
      - .:/app
docker compose up -d

3. View Container Logs

docker logs -f myapp

4. Access the Container Shell

docker exec -it myapp sh

Or, if the container uses a Linux base image:

docker exec -it myapp bash

5. Monitor Resource Usage

docker stats

 

Section 3: Managing Volumes and Networks

1. Create a Volume

docker volume create mydata

2. Attach a Volume to a Container

docker run -d -v mydata:/data nginx

3. Inspect Volume Details

docker volume inspect mydata

4. Create a Custom Network

docker network create mynetwork

5. 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 prune

2. Remove Unused Images

docker image prune

3. Wipe Everything Clean (Use with Caution!)

docker system prune -a

 

Section 5: Must-Know Daily Docker Commands for Developers

TaskCommand
View container IP addressdocker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' myapp
Copy file into a containerdocker cp ./localfile.txt myapp:/app/
Copy file out of a containerdocker cp myapp:/app/output.txt ./
Check port mappingdocker port myapp
Restart a containerdocker 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.