Mastering DevOps Batch Lecture 13 Docker Storage & Networking Volumes, Bind Mount, tmpfs, Bridge

Опубликовано: 10 Март 2026
на канале: Raman Sharma
13
0

Welcome to Mastering DevOps Batch – Lecture 13 🚀

In this lecture, we explored Docker Storage and Networking concepts with hands-on practical examples.

You will learn how Docker manages container storage and how containers communicate with each other using Docker networks.

This is a very important topic for real DevOps environments, especially when running applications like databases, microservices, and distributed systems.

📦 Docker Storage Topics Covered
Non-Persistent Storage

✔ Default container writable layer
✔ Data loss when container is deleted
✔ tmpfs storage (memory-based storage)

Commands demonstrated:

docker container run -it --name mycon -d ubuntu
docker exec -it mycon mkdir /testdir
docker exec -it mycon touch /testdir/test.java
docker restart mycon
docker rm -f mycon

tmpfs example:

docker container run -it --name mycon --mount type=tmpfs,destination=/mydir -d ubuntu
docker exec -it mycon touch /mydir/temp.java
docker restart mycon
💾 Persistent Storage
Docker Volumes

We learned:

Creating volumes

Volume storage location

Attaching volumes to containers

Sharing volumes between containers

Read-only volumes

Commands demonstrated:

docker volume create demo-vol
docker volume ls
docker container run -it --name c2 --mount source=demo-vol,destination=/demo -d ubuntu
docker exec -it c2 touch /demo/demo.java
docker inspect c2
docker rm -f c2

Volume path in Linux:

/var/lib/docker/volumes/
Bind Mount

Bind mounts connect a host directory to a container directory.

Example:

mkdir mydir
docker container run -it --name c1 -v /home/raman/mydir:/demo -d ubuntu
docker exec -it c1 touch /demo/demo.java

Bind mount using --mount:

docker container run -it --name c1 --mount type=bind,source=/home/raman/mydir/,destination=/demo1 -d ubuntu
🌐 Docker Networking Concepts

We also covered Docker Networking fundamentals.

Docker provides multiple network types:

✔ Bridge (default)
✔ Host
✔ None
✔ Custom bridge networks

Default Bridge Network

Containers automatically connect to the bridge network.

docker network ls
docker run -it --name c1 -d centos:7
docker inspect c1
docker exec -it c1 ip a
Custom Docker Network

Creating a custom bridge network:

docker network create -d bridge webnetwork --subnet 192.168.0.0/16 --gateway 192.168.0.1
docker network inspect webnetwork

Running containers on custom network:

docker container run -it --name web -p 80:80 --network webnetwork -d ramansharma95/webapp
docker container run -it --name db --network webnetwork -d ramansharma95/mysql
Host Network

Container shares host network stack.

docker container run -it --name web --network host -d nginx
None Network

Container runs without network connectivity.

docker container run -it --name n1 --network none -d centos:7

Attach network later:

docker network connect bridge n1
🎯 What You Will Learn

✔ Docker storage architecture
✔ Persistent vs Non-Persistent storage
✔ Docker volumes
✔ Bind mounts
✔ tmpfs storage
✔ Docker bridge network
✔ Custom networks
✔ Host and none networks
✔ Container communication

🚀 Why This Lecture is Important

In real DevOps environments we use:

Docker volumes for databases

Bind mounts for development

Custom networks for microservices

Understanding Docker storage and networking is critical for Kubernetes and production deployments.

🏷️ YouTube Tags (Comma Separated)

docker storage tutorial, docker volumes tutorial, docker persistent storage, docker non persistent storage, docker tmpfs example, docker bind mount tutorial, docker volume create example, docker storage devops, docker networking tutorial, docker bridge network explained, docker host network tutorial, docker none network example, docker custom network tutorial, docker container networking, docker volumes vs bind mount, docker devops course, mastering devops batch, docker practical tutorial, docker interview questions, docker for beginners, docker container storage, docker network create bridge, docker networking devops