๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes

Hello dev.to community! ๐Ÿ‘‹

Yesterday, I explored Docker Basics โ€” the foundation of containerization. Today, Iโ€™m diving into Networking & Volumes in Docker โ€” two essential concepts that bring containers closer to real-world use cases. ๐Ÿณ

๐Ÿ”น Why Netwo…


This content originally appeared on DEV Community and was authored by Bhaskar Sharma

Hello dev.to community! ๐Ÿ‘‹

Yesterday, I explored Docker Basics โ€” the foundation of containerization. Today, Iโ€™m diving into Networking & Volumes in Docker โ€” two essential concepts that bring containers closer to real-world use cases. ๐Ÿณ

๐Ÿ”น Why Networking & Volumes Matter

Networking โ†’ lets containers communicate with each other and the outside world.

Volumes โ†’ ensure data persists even if containers are removed.

In DevOps, both are crucial for building reliable, production-ready systems.

๐Ÿง  Core Concepts Iโ€™m Learning

๐ŸŒ Docker Networking

Bridge network (default): containers get private IPs and can talk to each other.

Host network: container shares hostโ€™s network.

Overlay network: connects containers across multiple hosts (used in Swarm/K8s).

๐Ÿ”ง Example:

Create a custom bridge network

docker network create mynet

Run two containers in the same network

docker run -d --name web --network mynet nginx

docker run -it --network mynet alpine ping web

๐Ÿ’พ Docker Volumes

Volumes store data outside container lifecycle.

Great for databases, logs, and config files.

Types: named volumes, host mounts, anonymous volumes.

๐Ÿ”ง Example:

Create a volume

docker volume create mydata

Run MySQL with volume

docker run -d -v mydata:/var/lib/mysql mysql

๐Ÿ› ๏ธ Mini Use Cases in DevOps

Run a database container with volumes to persist data.

Connect backend & frontend containers via networks.

Share config files securely across multiple services.

โšก Pro Tips

Use named volumes instead of host paths for portability.

Inspect networks with:

docker network ls

docker network inspect mynet

Clean up unused volumes & networks:

docker volume prune

docker network prune

๐Ÿงช Hands-on Mini-Lab (Try this!)

1๏ธโƒฃ Create a network:

docker network create devnet

2๏ธโƒฃ Run Nginx & Redis in the same network:

docker run -d --name mynginx --network devnet nginx

docker run -d --name myredis --network devnet redis

3๏ธโƒฃ Verify connectivity:

docker exec -it mynginx ping myredis

๐ŸŽฏ Containers are now talking to each other inside devnet! ๐Ÿš€

๐ŸŽฏ Key Takeaway
Networking connects containers like a mini-internet, while volumes ensure data survives beyond container restarts. Together, they make Docker production-grade.

๐Ÿ”œ Tomorrow (Day 9)
Iโ€™ll dive into Dockerfiles & Image Building โ€” automating app packaging for CI/CD pipelines.

๐Ÿ”– #Docker #Containers #DevOps #CICD #DevOpsJourney #CloudNative #SRE #Automation #OpenSource


This content originally appeared on DEV Community and was authored by Bhaskar Sharma


Print Share Comment Cite Upload Translate Updates
APA

Bhaskar Sharma | Sciencx (2025-09-08T01:48:42+00:00) ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes. Retrieved from https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/

MLA
" » ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes." Bhaskar Sharma | Sciencx - Monday September 8, 2025, https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/
HARVARD
Bhaskar Sharma | Sciencx Monday September 8, 2025 » ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes., viewed ,<https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/>
VANCOUVER
Bhaskar Sharma | Sciencx - » ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/
CHICAGO
" » ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes." Bhaskar Sharma | Sciencx - Accessed . https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/
IEEE
" » ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes." Bhaskar Sharma | Sciencx [Online]. Available: https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/. [Accessed: ]
rf:citation
» ๐Ÿš€ Day 8 of My DevOps Journey: Docker Networking & Volumes | Bhaskar Sharma | Sciencx | https://www.scien.cx/2025/09/08/%f0%9f%9a%80-day-8-of-my-devops-journey-docker-networking-volumes/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.