This content originally appeared on DEV Community and was authored by Bhaskar Sharma
Hello dev.to community! ๐
Yesterday, I explored GitHub Actions, GitHubโs native CI/CD tool that makes automation seamless.
Today, Iโm diving into Docker, the backbone of containerization in DevOps.
๐น Why Docker Matters
Before Docker, apps often suffered from the classic โworks on my machineโ problem. Docker solves this by packaging applications with all dependencies into portable containers.
โ
Consistent environment across dev, test, and prod
โ
Lightweight and faster than virtual machines
โ
Easy scaling with orchestration tools (like Kubernetes)
โ
Huge ecosystem with Docker Hub images
๐ง Core Concepts in Docker
Image โ Blueprint of your application (built using a Dockerfile)
Container โ Running instance of an image
Dockerfile โ Instructions to build an image
Registry โ Storage for images (Docker Hub, ECR, GCR)
Volume โ Persistent storage for containers
Network โ Communication between containers
๐ง Example: Simple Dockerfile
Use Node.js base image
FROM node:18
Set working directory
WORKDIR /app
Copy package files and install dependencies
COPY package*.json ./
RUN npm install
Copy source code
COPY . .
Expose app port
EXPOSE 3000
Start the app
CMD ["npm", "start"]
๐ Build and run it:
docker build -t myapp .
docker run -p 3000:3000 myapp
๐ ๏ธ DevOps Use Cases
Package applications for CI/CD pipelines
Deploy microservices on Kubernetes or ECS
Create reproducible environments for testing
Run security scans (e.g., Trivy) on container images
โก Pro Tips
Keep images small โ use slim/alpine base images
Use .dockerignore to avoid unnecessary files in builds
Tag images properly (e.g., myapp:v1.0.0)
Scan images for vulnerabilities before pushing to registry
๐งช Hands-on Mini-Lab (Try this!)
1๏ธโฃ Install Docker Desktop
2๏ธโฃ Write a Dockerfile for your app
3๏ธโฃ Build and run the image locally
4๏ธโฃ Push it to Docker Hub with docker push
๐ฏ Key Takeaway
Docker makes applications portable, scalable, and easy to manage โ a cornerstone skill for every DevOps engineer.
๐ Tomorrow (Day 21):
Iโll explore Kubernetes โ the orchestration layer that takes Docker to production scale.
๐ #Docker #DevOps #Containers #Automation #SRE
This content originally appeared on DEV Community and was authored by Bhaskar Sharma
Bhaskar Sharma | Sciencx (2025-09-20T02:18:17+00:00) โ Day 20 of My DevOps Journey: Docker โ Containerization Made Simple ๐. Retrieved from https://www.scien.cx/2025/09/20/%e2%9a%93-day-20-of-my-devops-journey-docker-containerization-made-simple-%f0%9f%9a%80/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.