<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mugil Shabareeshwaran  on Medium]]></title>
        <description><![CDATA[Stories by Mugil Shabareeshwaran  on Medium]]></description>
        <link>https://medium.com/@harimugunthan2004?source=rss-78741725a161------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h-vJFQns6_FdJWOOs8Gy6Q.jpeg</url>
            <title>Stories by Mugil Shabareeshwaran  on Medium</title>
            <link>https://medium.com/@harimugunthan2004?source=rss-78741725a161------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:57:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harimugunthan2004/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Containerizing an Application Isn’t Hard]]></title>
            <link>https://medium.com/@harimugunthan2004/containerizing-an-application-isnt-hard-d72dd86b4b8a?source=rss-78741725a161------2</link>
            <guid isPermaLink="false">https://medium.com/p/d72dd86b4b8a</guid>
            <category><![CDATA[docker-command]]></category>
            <category><![CDATA[dockerfile-example]]></category>
            <category><![CDATA[containerize-application]]></category>
            <category><![CDATA[dockerfile-basic]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Mugil Shabareeshwaran ]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 18:37:30 GMT</pubDate>
            <atom:updated>2026-09-01T18:37:30.987Z</atom:updated>
            <content:encoded><![CDATA[<h4>Containerizing an application isn’t magic.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Q1_Msm4TSb-18XBB.jpeg" /><figcaption>Dockerfile → Image → Container</figcaption></figure><p>You write a few instructions in a Dockerfile, Docker turns those instructions into an <strong>image</strong>, and Docker creates a <strong>container</strong> from that image.</p><p>Once you understand this flow, Docker becomes much easier to work with</p><p>When I first started learning Docker, the commands looked like a lot to remember:</p><pre>docker build<br>docker run<br>docker ps<br>docker stop<br>docker push<br>docker pull</pre><p>But instead of memorizing these commands, let’s understand <strong>what Docker is actually doing.</strong></p><p>You have an application.</p><p>You create a <strong>Dockerfile</strong> that tells Docker how to package that application.</p><p>Docker builds an <strong>image</strong> from that Dockerfile.</p><p>Then you run that image as a <strong>container</strong>.</p><p>That’s it.</p><pre>Dockerfile<br>    ↓      docker build<br>  Image<br>    ↓      docker run<br>Container<br>    ↓      docker push<br>Registry<br>    ↓      docker pull<br>  Image<br>    ↓      docker run<br>Container</pre><p>Let’s understand this step by step.</p><h3>1. Writing the Dockerfile</h3><p>A Dockerfile is simply a file containing instructions for building our application image.</p><p>For example:</p><pre>FROM node:20<br><br>WORKDIR /app<br><br>COPY package*.json ./<br><br>RUN npm install<br><br>COPY . .<br><br>EXPOSE 3000<br><br>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p>Don’t worry about memorizing everything.</p><p>Each instruction has a simple purpose:</p><pre>FROM       → Choose the base image<br>WORKDIR    → Set the working directory<br>COPY       → Copy files into the image<br>RUN        → Execute a command while building<br>ENV        → Set environment variables<br>ARG        → Set build-time variables<br>EXPOSE     → Document the application port<br>USER       → Choose the user that runs the application<br>VOLUME     → Define a location for persistent data<br>CMD        → Default command when the container starts<br>ENTRYPOINT → Main executable of the container</pre><p>For most basic applications, you will mainly see:</p><pre>FROM<br>WORKDIR<br>COPY<br>RUN<br>EXPOSE<br>CMD</pre><h3>FROM</h3><pre>FROM node:20</pre><p>This tells Docker:</p><p><em>Start with an image that already has Node.js 20.</em></p><h3>WORKDIR</h3><pre>WORKDIR /app</pre><p>This sets the working directory inside the container.</p><h3>COPY</h3><pre>COPY . .</pre><p>This copies the application files into the image.</p><h3>RUN</h3><pre>RUN npm install</pre><p>This runs a command <strong>while building the image</strong>.</p><h3>EXPOSE</h3><pre>EXPOSE 3000</pre><p>This tells Docker that the application uses port 3000.</p><p>EXPOSE documents the port the application listens on. It does <strong>not</strong> publish that port to the host. Port publishing is done with docker run -p.</p><h3>CMD</h3><pre>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p>This tells Docker what command to run when the container starts.</p><p>So the important difference is:</p><pre>RUN → Build time</pre><pre>CMD → Container startup</pre><h3>2. Build the Image</h3><p>Now we have a Dockerfile.</p><p>We can build the image:</p><pre>docker build -t my-app .</pre><p>Here:</p><pre>docker build → Build an image<br>-t           → Give the image a name<br>my-app       → Image name<br>.            → Use the current directory</pre><p>Docker reads the Dockerfile and creates an image.</p><pre>Dockerfile<br>     ↓<br>docker build<br>     ↓<br>Image</pre><p>We can check the image:</p><pre>docker images</pre><h3>3. Run the Container</h3><p>An image is not a running process. We create a container from the image to run the application.</p><p>We need to create a container from it.</p><pre>docker run my-app</pre><p>Docker takes the image and creates a container.</p><pre>Image<br>  ↓<br>docker run<br>  ↓<br>Container</pre><p>If our application uses port 3000:</p><pre>docker run -p 3000:3000 my-app</pre><p>The format is:</p><pre>-p HOST_PORT:CONTAINER_PORT</pre><p>So:</p><pre>3000:3000</pre><p>means:</p><pre>Your Machine<br>    3000<br>      ↓<br>Container<br>    3000</pre><h3>4. Check the Container</h3><p>To see running containers:</p><pre>docker ps</pre><p>To see all containers, including stopped ones:</p><pre>docker ps -a</pre><p>If the application isn’t behaving as expected, check its logs:</p><pre>docker logs &lt;container&gt;</pre><p>We can also enter a running container:</p><pre>docker exec -it &lt;container&gt; sh</pre><p>These commands are mainly useful for checking and troubleshooting.</p><h3>5. Stop and Remove</h3><p>To stop a container:</p><pre>docker stop &lt;container&gt;</pre><p>To remove it:</p><pre>docker rm &lt;container&gt;</pre><p>To remove an image:</p><pre>docker rmi my-app</pre><p>Remember:</p><pre>docker stop → Stop container<br>docker rm   → Remove container<br>docker rmi  → Remove image</pre><h3>6. Push the Image</h3><p>So far, everything is on our local machine.</p><p>But what if we want to run the same application on another server?</p><p>We don’t need to copy the entire application manually.</p><p>We can push the Docker image to a container registry.</p><p>First, tag the image:</p><pre>docker tag my-app username/my-app:latest</pre><p>Then login:</p><pre>docker login</pre><p>And push:</p><pre>docker push username/my-app:latest</pre><p>Now the image is stored in the registry.</p><pre>Local Image<br>     ↓<br>docker push<br>     ↓<br>Registry</pre><h3>7. Pull the Image</h3><p>On another machine, we can download the image:</p><pre>docker pull username/my-app:latest</pre><p>Now the image exists on that machine.</p><pre>Registry<br>    ↓<br>docker pull<br>    ↓<br>Image</pre><p>And we can run it:</p><pre>docker run -p 3000:3000 username/my-app:latest</pre><p>That’s the entire workflow.</p><h3>The Docker Mental Model</h3><p>Instead of memorizing Docker commands separately, remember this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvJpGJFaOeJ0PayAXnVozQ.png" /></figure><p>The commands are simply actions on these objects.</p><pre>docker build  → Image<br>docker run    → Container<br>docker ps     → Containers<br>docker logs   → Container logs<br>docker stop   → Container<br>docker rm     → Container<br>docker push   → Registry<br>docker pull   → Image</pre><h3>Final Thoughts</h3><p>Containerizing an application isn’t hard.</p><p>The hardest part is usually trying to memorize Docker commands without understanding what they are doing.</p><p>Once you understand these four things:</p><pre>Dockerfile<br>    ↓<br>Image<br>    ↓<br>Container<br>    ↓<br>Registry</pre><p>the commands become much easier.</p><p>A Dockerfile tells Docker <strong>how to build the application image</strong>.</p><p>An image is the <strong>packaged application</strong>.</p><p>A container is a <strong>running instance of that image</strong>.</p><p>A registry is where we <strong>store and share images</strong>.</p><p>That’s Docker at its core.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d72dd86b4b8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Under the Hood]]></title>
            <link>https://medium.com/@harimugunthan2004/docker-under-the-hood-d59f03a670c9?source=rss-78741725a161------2</link>
            <guid isPermaLink="false">https://medium.com/p/d59f03a670c9</guid>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[docker-basic]]></category>
            <category><![CDATA[docker-under-the-hood]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Mugil Shabareeshwaran ]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 17:05:07 GMT</pubDate>
            <atom:updated>2026-08-29T17:05:07.715Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I knew the Docker commands. But I wanted to understand what was actually happening behind them</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*3oiHyrRbLnjyPQTx" /><figcaption>Docker Under the Hood</figcaption></figure><p>Docker is often introduced through a few simple commands:</p><pre>docker build<br>docker push<br>docker pull<br>docker run<br>docker ps</pre><p>The commands are easy to remember. But understanding <strong>what happens behind them</strong> makes Docker much easier to work with.</p><p>This article follows one simple journey:</p><pre>Dockerfile<br>    ↓<br>   Build<br>    ↓<br>  Image<br>    ↓<br>   Push<br>    ↓<br> Registry<br>    ↓<br>   Pull<br>    ↓<br>  Image<br>    ↓<br>   Run<br>    ↓<br>Container</pre><h3>What is Docker?</h3><p>Docker is a platform for <strong>building, shipping, and running applications in containers</strong>.</p><p>Instead of installing an application and its dependencies directly on a server, we package them into a Docker image.</p><p>That image can then be used to create containers.</p><pre>Application + Dependencies<br>          ↓<br>      Docker Image<br>          ↓<br>       Container</pre><p>An <strong>image</strong> is the packaged application.</p><p>A <strong>container</strong> is a runnable instance of that image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YoLxlK5Wk5tyuhU6.png" /></figure><h3>Why Docker?</h3><p>The main problem Docker helps solve is consistency.</p><p>An application may work on a developer’s machine but fail in another environment because of different runtime versions, libraries, or system dependencies.</p><p>With Docker, we can package the application and its dependencies into an image and use the same image across environments:</p><pre>Development<br>     ↓<br> Docker Image<br>     ↓<br> Staging<br>     ↓<br> Production</pre><p>This makes application delivery more predictable and portable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyM7UFCKgDPFRsgXmBw96w.png" /></figure><h3>Dockerfile: Where It Starts</h3><p>Everything starts with a <strong>Dockerfile</strong>.</p><p>A Dockerfile is a text file containing a set of instructions that Docker uses to build a Docker image.</p><p>For example:</p><pre># Use Python as the base image<br>FROM python:3.12-slim<br><br># Set the working directory<br>WORKDIR /app<br><br># Copy dependency file<br>COPY requirements.txt .<br><br># Install dependencies<br>RUN pip install --no-cache-dir -r requirements.txt<br><br># Copy application code<br>COPY . .<br><br># Document the application port<br>EXPOSE 8000<br><br># Start the application<br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>Each instruction has a specific purpose:</p><ul><li><strong>FROM</strong> — Defines the base image.</li><li><strong>WORKDIR</strong> — Sets the working directory inside the image.</li><li><strong>COPY</strong> — Copies files from the build context into the image.</li><li><strong>RUN</strong> — Executes a command while building the image.</li><li><strong>EXPOSE</strong> — Documents the port the application uses.</li><li><strong>CMD</strong> — Defines the default command to run when the container starts.</li></ul><p>Think of it as:</p><pre>Dockerfile  = Instructions<br>      ↓<br>docker build<br>      ↓<br>Docker Image = Result</pre><p>The Dockerfile doesn’t run the application itself. It defines <strong>how the image should be built</strong>.</p><p>Once the Dockerfile is ready, we can use docker build to create the image.</p><h3>The Docker Daemon</h3><p>Before looking at the commands, there is one important component to understand: the <strong>Docker Daemon (</strong><strong>dockerd)</strong>.</p><p>Docker follows a client-server architecture.</p><p>The Docker CLI is the client we interact with, while dockerd is the long-running background process that manages Docker objects such as images, containers, networks, and volumes.</p><pre>Docker CLI<br>                 ↓<br>          Docker Daemon<br>             dockerd<br>                 ↓<br>       Docker Engine Components<br>                 ↓<br>        Images / Containers</pre><p>So when we type a command such as:</p><pre>docker run app</pre><p>the Docker CLI sends the request to the Docker daemon, which performs the operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8T2Xx0H4Ml1SPfeJJF2B4Q.png" /></figure><h3>Following the Docker Workflow</h3><p>Now let’s follow what happens when we build, distribute, and run an application.</p><h3>1. docker build — Create the Image</h3><p>We start with the Dockerfile:</p><pre>docker build -t myapp:1.0 .</pre><p>The Docker client sends the build request to the daemon.</p><p>Docker reads the Dockerfile and build context and creates the image. Docker images are composed of layers, allowing unchanged layers to be reused during builds.</p><pre>Dockerfile<br>    ↓<br>docker build<br>    ↓<br>Docker Daemon<br>    ↓<br>Image Layers<br>    ↓<br>Docker Image</pre><p>At the end of the build, we have:</p><pre>myapp:1.0</pre><p>stored in the local Docker environment.</p><h3>2. docker push — Send the Image to a Registry</h3><p>The image is now available locally, but another server cannot use it unless it can access the image.</p><p>We push it to a container registry:</p><pre>docker push username/myapp:1.0</pre><p>The registry stores and distributes container images.</p><pre>Local Image<br>     ↓<br>docker push<br>     ↓<br>Docker Daemon<br>     ↓<br>Container Registry</pre><p>The registry could be Docker Hub, Amazon ECR, GitHub Container Registry, or a private registry.</p><h3>3. docker pull — Download the Image</h3><p>Now imagine we are on a production server.</p><p>The image isn’t available locally, so we pull it:</p><pre>docker pull username/myapp:1.0</pre><p>Docker contacts the registry and downloads the image layers required locally.</p><pre>Container Registry<br>        ↓<br>    docker pull<br>        ↓<br>   Docker Daemon<br>        ↓<br>    Local Image</pre><p>If the server already has some required layers, they can be reused.</p><p>Now the production server has the same image we built earlier.</p><h3>4. docker run — Turn the Image into a Container</h3><p>This is where the image becomes useful.</p><p>We run:</p><pre>docker run -d -p 8080:80 myapp:1.0</pre><p>Docker uses the image to create and start a container.</p><p>Conceptually:</p><pre>Docker Image<br>     ↓<br>Docker Daemon<br>     ↓<br>Create Container<br>     ↓<br>Filesystem + Network<br>     ↓<br>Start Application<br>     ↓<br>Running Container</pre><p>The container is an isolated runtime environment for the application.</p><p>Under the hood, Docker uses operating-system features such as namespaces and cgroups to provide isolation and resource controls.</p><p>The important distinction is:</p><blockquote><strong><em>A container is not a virtual machine.</em></strong></blockquote><p>A container shares the host kernel while running its processes in an isolated environment.</p><h3>5. docker ps — See the Running Container</h3><p>Once the container is running, we can check it with:</p><pre>docker ps</pre><p>The Docker CLI asks the daemon for the current container information.</p><pre>docker ps<br>    ↓<br>Docker Daemon<br>    ↓<br>Container Information<br>    ↓<br>Terminal</pre><p>If we want to see stopped containers as well:</p><pre>docker ps -a</pre><h3>The Complete Picture</h3><p>Now we can connect everything:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tcAHEWw6IM7-GWilgDdSnQ.png" /></figure><h3>Final Thoughts</h3><p>Docker becomes much easier to understand when we stop looking at its commands individually.</p><p>The complete journey is:</p><p><strong>Dockerfile → Build → Image → Push → Registry → Pull → Run → Container</strong></p><p>The <strong>Docker CLI</strong> is what we use to interact with Docker, while the <strong>Docker Daemon (</strong><strong>dockerd)</strong> handles the actual Docker operations.</p><p>Once the image reaches the target machine, docker run creates a container from it, and docker ps lets us see the result.</p><p>That’s the basic Docker workflow — from a few lines in a Dockerfile to a running application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d59f03a670c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>