Hello Everyone as part of my journey transitioning to DevSecOps, today i dove into Docker.
In simple terms Docker is a software platform that allows you to build, test and deploy your applications quickly. Today i learned about four core concept of Docker, and i want to share my understanding with you all.
1. Docker Images (The Blueprint)
An image is basically the blueprint for a container.We create this blueprint by writing some instructions inside a file called a Dockerfile. it contains everything your application needs to run - the code, runtime, libraries, and environment variables.
2. Docker Container (The Running App)
If an image is a blueprint, then a container is the actual building. A container is simply the running instance of a Docker Image. You can start, stop, or delete a container anytime without affecting the original image.
3. Docker Volume (Permanent Storage)
By default, data inside the container temporary. this is where a volume come in. Volumes provide permanent storage for your container's data by saving it directly to your hard drive.
Real World Example: Suppose we host a database(like mongoDB) inside a container, and we have 1,000 users registered. if we delete or restart the container, all the users data will be lost. To prevent this we use a volume to safety store that database information permanently on the host machine.
4. Docker Network (The Communication Bridge)
When we create and run multiple containers at the same time, they are completely isolated from each other by default for security.
However in real applications, they need to communicate. For example if i have a Node.js backend running in one container and a database in another container, they need to talk each other. We Use Docker Networks to create a secure connection between these isolated containers.
My Journey Continues
Understanding these four concepts completely changed how I look at deployments. No more "It work's on my machine".
Top comments (0)