Hello dev.to community! π
Yesterday, I explored Linux Services & Systemd β the backbone of process management. Today, Iβm diving into Docker β the magic behind modern containerization. π³
πΉ Why Docker matters for DevOps
Consistent environments: βWorks on my machineβ β no more!
Lightweight containers replace heavy VMs.
Standard for running apps in CI/CD pipelines.
Foundation for Kubernetes & cloud-native systems.
π§ Core concepts Iβm learning
βοΈ What is Docker?
A containerization platform that packages apps + dependencies.
Containers share the host OS kernel but remain isolated.
π¦ Docker Images & Containers
Image = blueprint (e.g., nginx:latest).
Container = running instance of an image.
π§ Basic Docker commands
Run a container:
docker run -it ubuntu bash
List containers:
docker ps -a
Stop & remove container:
docker stop
docker rm
Pull an image:
docker pull nginx
Build an image:
docker build -t myapp .
ποΈ Volumes & Port Mapping
Volumes persist data β docker run -v /data:/var/lib/mysql mysql
Ports expose services β docker run -p 8080:80 nginx
π οΈ Mini use cases for DevOps
Run Jenkins, Nginx, or Redis in containers.
Test apps in isolated environments.
Package CI/CD pipelines into reusable images.
β‘ Pro tip
If a container fails:
Check logs β docker logs
Inspect configuration β docker inspect
Exec into container β docker exec -it bash
π§ͺ Hands-on mini-lab (try this!)
Run an Nginx container:
docker run -d -p 8080:80 nginx
Verify:
Open β http://localhost:8080
π― You should see the Nginx welcome page in a container! π
π― Key takeaway
Docker is the backbone of DevOps β making apps portable, lightweight, and production-ready. Mastering Docker is the first step toward Kubernetes.
π Tomorrow (Day 8)
Iβll explore Docker Networking & Volumes β connecting containers and persisting data.
π #Docker #Containers #DevOps #CICD #DevOpsJourney #SRE #CloudNative #Automation #OpenSource
Top comments (0)