From faa21dc9aba6777daf277e38c7600ab1e0248d5a Mon Sep 17 00:00:00 2001 From: Akil36 <123194081+Akil36@users.noreply.github.com> Date: Mon, 5 May 2025 20:34:59 +0530 Subject: [PATCH] Update docker-basics.md Improve Docker Basics section with examples, analogy, formatting --- .../roadmaps/docker/content/docker-basics.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/data/roadmaps/docker/content/docker-basics.md b/src/data/roadmaps/docker/content/docker-basics.md index 5ceeedcfc..548a5304c 100644 --- a/src/data/roadmaps/docker/content/docker-basics.md +++ b/src/data/roadmaps/docker/content/docker-basics.md @@ -1,18 +1,23 @@ # Docker Basics -Docker is a platform that simplifies the process of building, packaging, and deploying applications in lightweight, portable containers. In this section, we'll cover the basics of Docker, its components, and key commands you'll need to get started. +Docker is a platform that makes it easier to build, package, and run applications using lightweight, portable containers. It ensures your app behaves the same on any system — from a developer’s laptop to a cloud server. ## What is a Container? -A container is a lightweight, standalone, and executable software package that includes all the dependencies (libraries, binaries, and configuration files) required to run an application. Containers isolate applications from their environment, ensuring they work consistently across different systems. +A container is like a box that holds everything an app needs to run: + - Your app’s code + - System tools and libraries + - Config files + +Think of it like a lunchbox 🍱: wherever you take it — home, school, office — your lunch stays the same. Likewise, containers ensure your app behaves consistently across machines. ## Docker Components There are three key components in the Docker ecosystem: -- **Dockerfile**: A text file containing instructions (commands) to build a Docker image. -- **Docker Image**: A snapshot of a container, created from a Dockerfile. Images are stored in a registry, like Docker Hub, and can be pulled or pushed to the registry. -- **Docker Container**: A running instance of a Docker image. +- **Dockerfile**: A recipe that tells Docker how to build an image. +- **Docker Image**: A snapshot of the app and its environment, created from a Dockerfile. +- **Docker Container**: A running instance of an image — like launching the app from a template. ## Docker Commands @@ -26,3 +31,7 @@ Below are some essential Docker commands you'll use frequently: - `docker container stop `: Stop a running container. - `docker container rm `: Remove a stopped container. - `docker image rm `: Remove an image from your local machine. + +## Docker Commands + +Docker containers are ephemeral. When you delete them, they’re gone — unless you save data using volumes.