Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › DevOps

Chapter 7: Docker Commands, Networks, Volumes and Compose: Cards

मराठी cards · Open the chapter

Revision cards

Everyday Docker commands and what you see. Most Docker work is running, looking and fixing.
Revision card 1 of 10: Everyday Docker commands and what you see · Download PNG · Open card page

Lesson: 7.1 Everyday commands and what you see

Network types: when to use which. Containers can't reach each other without the right network.
Revision card 2 of 10: Network types: when to use which · Download PNG · Open card page

Lesson: 7.2 Network types — when to use which

Two containers talking by name. Apps need stable names, not changing IPs.
Revision card 3 of 10: Two containers talking by name · Download PNG · Open card page

Lesson: 7.3 Two containers talking by name

Volume types: data, code and secrets. Container files vanish when the container is removed.
Revision card 4 of 10: Volume types: data, code and secrets · Download PNG · Open card page

Lesson: 7.4 Volume types — data, code and secrets

Compose file: one stack, one up. Long docker run commands are hard to share.
Revision card 5 of 10: Compose file: one stack, one up · Download PNG · Open card page

Lesson: 7.5 Compose file — one stack, one up

env files: never commit real secrets. Committed .env files leak passwords.
Revision card 6 of 10: env files: never commit real secrets · Download PNG · Open card page

Lesson: 7.6 Env files — never commit real secrets

compose up, down, logs, ps. Four commands run the whole stack lifecycle.
Revision card 7 of 10: compose up, down, logs, ps · Download PNG · Open card page

Lesson: 7.7 Compose up, down, logs, ps

Small Compose habits. Small habits prevent big surprises.
Revision card 8 of 10: Small Compose habits · Download PNG · Open card page

Lesson: 7.8 Small Compose habits

Troubleshooting Docker. The same few errors cause most Docker pain.
Revision card 9 of 10: Troubleshooting Docker · Download PNG · Open card page

Lesson: 7.9 Troubleshooting

Lab: commands, a name, a volume, one stack. Doing it once ties all the pieces together.
Revision card 10 of 10: Lab: commands, a name, a volume, one stack · Download PNG · Open card page

Lesson: 7.10 Lab — commands, a name, a volume, one stack

Interview cards

A container keeps exiting. What do you do? docker ps -a to see exit code, docker logs for the error, then fix the command or config.
Interview card 1 of 10: A container keeps exiting. What do you do? · Download PNG · Open card page

Lesson: 7.1 Everyday commands and what you see

Default bridge vs user-defined bridge? User-defined bridges let containers find each other by name and isolate stacks; the default bridge doesn't do name lookup.
Interview card 2 of 10: Default bridge vs user-defined bridge? · Download PNG · Open card page

Lesson: 7.2 Network types — when to use which

How does one container reach another? Put both on the same user-defined network and use the container name as hostname.
Interview card 3 of 10: How does one container reach another? · Download PNG · Open card page

Lesson: 7.3 Two containers talking by name

Volume vs bind mount? Volume: managed by Docker, best for data. Bind mount: a host path you choose, best for live code editing.
Interview card 4 of 10: Volume vs bind mount? · Download PNG · Open card page

Lesson: 7.4 Volume types — data, code and secrets

What is Docker Compose for? Defining and running a multi-container app (web, db, cache) from one YAML file, mainly for dev and small setups.
Interview card 5 of 10: What is Docker Compose for? · Download PNG · Open card page

Lesson: 7.5 Compose file — one stack, one up

How do you handle secrets with Compose? Keep them in an uncommitted .env or Docker/CI secrets; commit only a .env.example.
Interview card 6 of 10: How do you handle secrets with Compose? · Download PNG · Open card page

Lesson: 7.6 Env files — never commit real secrets

docker compose down vs down -v? down removes containers and networks. down -v also deletes volumes, so data is lost.
Interview card 7 of 10: docker compose down vs down -v? · Download PNG · Open card page

Lesson: 7.7 Compose up, down, logs, ps

Why avoid the latest tag? latest can change any time, so builds aren't repeatable; a pinned tag gives the same image every time.
Interview card 8 of 10: Why avoid the latest tag? · Download PNG · Open card page

Lesson: 7.8 Small Compose habits

“Port is already allocated”: what now? Another process or container already uses that host port; find it with ss -tlnp or docker ps, stop it or map a different port.
Interview card 9 of 10: “Port is already allocated”: what now? · Download PNG · Open card page

Lesson: 7.9 Troubleshooting

Prove your DB data survives a container restart. Use a named volume, insert a row, remove and recreate the container, then read the row back.
Interview card 10 of 10: Prove your DB data survives a container restart. · Download PNG · Open card page

Lesson: 7.10 Lab — commands, a name, a volume, one stack

Comparison cards

Docker volume vs bind mount. Both keep files outside the container.Volume: storage Docker creates and manages.Bind mount: a folder from your PC mapped in.
Comparison card 1 of 3: Docker volume vs bind mount · Download PNG · Open card page

Lesson: 7.4 Volume types — data, code and secrets

docker run vs docker compose. docker run: start one container with a long command.docker compose: start a whole stack from one YAML file.
Comparison card 2 of 3: docker run vs docker compose · Download PNG · Open card page

Lesson: 7.5 Compose file — one stack, one up

Bridge network vs host network. Bridge: containers get their own private network; you publish ports.Host: container shares the server's network directly (Linux).
Comparison card 3 of 3: Bridge network vs host network · Download PNG · Open card page

Lesson: 7.2 Network types — when to use which