<?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 Rana Aurangzaib on Medium]]></title>
        <description><![CDATA[Stories by Rana Aurangzaib on Medium]]></description>
        <link>https://medium.com/@aurangzaib048?source=rss-59db3357fc4e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rMgdxUpQ4plmY5wDikOTSg.jpeg</url>
            <title>Stories by Rana Aurangzaib on Medium</title>
            <link>https://medium.com/@aurangzaib048?source=rss-59db3357fc4e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:25:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aurangzaib048/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[Docker Introduction — Part II]]></title>
            <link>https://aurangzaib048.medium.com/docker-introduction-part-ii-37654c6379ff?source=rss-59db3357fc4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/37654c6379ff</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[hands-on-tutorials]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[containerization]]></category>
            <dc:creator><![CDATA[Rana Aurangzaib]]></dc:creator>
            <pubDate>Sun, 08 Aug 2021 11:18:42 GMT</pubDate>
            <atom:updated>2021-08-08T11:30:01.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Introduction — Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t6NrejbQr6Pzo-8E.png" /><figcaption>Photo from <a href="https://www.keycdn.com/">KeyCDN</a></figcaption></figure><p><strong>Note:</strong> This article is an instructional exercise, so get some espresso, sit serenely, and create some containers. Today we will get familiar with the rudiments of Docker and how to build, run and even eliminate containers. 🐳</p><h3>Now let’s create your first application</h3><p>Now we have petty much idea of Docker. It’s time to create an application and containerized it using Docker.</p><p><a href="https://github.com/aurangzaib048/flask-docker">GitHub - aurangzaib048/flask-docker</a></p><blockquote><strong>Note:</strong> We will use the Python Flask application throughout our sessions.</blockquote><h4>Installation</h4><p>Since the installation relies upon your operating system, we won’t cover it in this tutorial. To install Docker on your OS, it’s not too much trouble. Follow the official docs:</p><ul><li><a href="https://docs.docker.com/docker-for-mac/install/">Install Docker for Mac</a></li><li><a href="https://docs.docker.com/docker-for-windows/install/">Install Docker for Windows</a></li><li><a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/">Get Docker CE for Ubuntu</a></li></ul><h4>Introduction to images</h4><p>Every Docker container is based on an image. Think of a Docker image as an instance of a running application. Images in Docker are sort of like Git repositories in that they can exist in multiple versions with committed changes.</p><p>You can obtain images from the DockerHub, or you can create your own. This tutorial will guide you through creating an image and container Docker. The docker search command allows you to search for images from the command line, and you can use the docker images command to view a list of locally available images at any time.</p><p>There are two main types of images:</p><p><strong>Base images:</strong> Sometimes called parent images, which provide an OS userspace.</p><p><strong>Child images:</strong> This builds upon base images to provide additional functionality.</p><h3>What is a Dockerfile?</h3><p>A Dockerfile is a text file that contains the instructions we use to build and run a Docker image. The following aspects of the image are defined:</p><ul><li>The base or parent image we use to create the new image</li><li>Commands to update the base OS and install additional software</li><li>Build artifacts to include, such as a developed application</li><li>Services to expose, such a storage and network configuration</li><li>Command to run when the container is launched</li></ul><p>Let’s map these aspects to an example Dockerfile. Suppose we’re creating a Docker image for our Python Flask website. The Dockerfile may look like the following example.</p><pre><strong><em># Step 1: Specify the parent image for the new image</em></strong><br>FROM python:3.8.10 </pre><pre><strong><em># Optional Step: Update OS packages and install additional software</em></strong></pre><pre><strong><em># Step 2: Creating and Configure work directory<br></em></strong>RUN mkdir /workspace &amp;&amp; mkdir /data<br>WORKDIR /workspace</pre><pre><strong><em># Step 3: Install workspace dependencies<br></em></strong>COPY ./requirements.txt ./requirements.txt <br>RUN pip install -r requirements.txt</pre><pre><strong><em># Step 4: Copy website code to container<br></em></strong>COPY ./ ./</pre><pre><strong><em># Step 5: Configure network requirements<br></em></strong>EXPOSE 5000</pre><pre><strong><em># Step 8: Define the entry point of the process that runs in the container</em></strong><br>ENTRYPOINT [&quot;python&quot;, &quot;app.py&quot;]</pre><p>We’re not going to cover the Dockerfile file specification here or the detail of each command in our above example. However, notice that there are several commands in this file that allow us to manipulate the structure of the image.</p><h3>How to build an image</h3><p>Now let’s build the image from the Dockerfile using the -t flag, which means tag, and set a name (flask_docker) and a tag (1.0):</p><pre>$ docker build -t flask_docker:1.0 .</pre><pre>$ docker images <br>REPOSITORY    TAG        IMAGE ID       CREATED          SIZE<br>flask_docker     0.1   c4ar69ueip25   1 minutes ago      170MB<br>python        3.8.10   2a3456r67822   1 weeks ago        156MB</pre><h3>How to run a container</h3><p>By typing docker images, we can see that the image was successfully created. Then let’s run the container specifying the port that will be mapped (-p) and using the -d flag, which means detached, so that the terminal does not get stuck. We must also pass the name and tag of the image as parameters (flask_docker:1.0).</p><pre>$ docker run -d -p 5000:5000 flask_docker:1.0<br>$ docker psCONTAINER ID   IMAGE           COMMAND            CREATED<br>c4ar69ueip25   flask_docker:1.0   &quot;python app.py&quot;   16 seconds ago<br>STATUS              PORTS                    NAMES<br>Up 3 seconds        0.0.0.0:5000-&gt;5000/tcp   container_gar</pre><p>The docker ps the command will show the running container with some other information.<br>Open your browser, go to the localhost:5000 address. We are accessing our web app, which is running inside the container.</p><h3>Stopping and Removing Containers</h3><p>As the container is still running, we can stop it before deleting it. To do so, we need to run docker stop passing the container name as a parameter, for example:</p><pre>$ docker stop container_gar</pre><p>We can also stop the container by using the container ID, for example:</p><pre>$ docker stop c4ar69ueip25</pre><p>If we run docker ps -a right now, we will see that the container is on that list with theExited status. Let’s delete the container and then delete the image.</p><p>Similar to the docker stop command, we can use the docker rm command passing the container name or ID as the parameter, for example:</p><pre>$ docker rm container_gar<br># or<br>$ docker rm c4ar69ueip25</pre><p>If we run docker ps -a now, we will see that our container has disappeared from the list.</p><p>As we have seen, the Docker command line is straightforward to use. You can continue discovering Docker commands by following the <a href="https://docs.docker.com/">Docker documentation</a>.</p><h3>Basic Commands</h3><p>In this segment, you might track down some fundamental Docker commands, like build, run, and exec, amongst others.</p><pre># Build a Docker image<br>$ docker build -t [image_name]:[tag] .</pre><pre># Run a Docker container specifying a name<br>$ docker run --name [container_name] [image_name]:[tag]</pre><pre># Fetch the logs of a container<br>$ docker logs -f [container_id_or_name]</pre><pre># Run a command in a running container<br>$ docker exec -it [container_id_or_name] bash</pre><pre># Show running containers<br>$ docker ps</pre><pre># Show all containers<br>$ docker ps -a</pre><pre># Show Docker images<br>$ docker images</pre><pre># Stop a Docker container<br>$ docker stop [container_id_or_name]</pre><pre># Remove a Docker container<br>$ docker rm [container_id_or_name]</pre><pre># Remove a Docker image<br>$ docker rmi [image_id_or_name]</pre><h3>My favorite Commands</h3><pre># Show the Resource utilization (It will show the CPU, mem, net I/O usage)<br>$ docker stats [OPTIONS] [CONTAINER]<br>$ docker stats --no-stream [CONTAINER]</pre><pre># Update the container resources like CPU, mem, core <br>$ docker update [OPTIONS] CONTAINER [CONTAINER...]</pre><h3>Useful Commands</h3><p>Some other useful commands to perform operations in multiple items:</p><pre># Stop all running containers<br>$ docker stop $(docker ps -q)</pre><pre># Remove all containers<br>$ docker rm $(docker ps -aq)</pre><pre># Remove all images<br>$ docker rmi $(docker images -aq)</pre><h3>Integration</h3><p>Docker can be integrated into various infrastructure tools, like <a href="https://cloud.google.com/">Google Cloud Platform (GCP)</a>, <a href="https://aws.amazon.com/">Amazon Web Services (AWS)</a>, <a href="https://azure.microsoft.com/en-us/">Microsoft Azure</a>, <a href="https://cloud.oracle.com/containers">Oracle Container Cloud Service</a>, etc.</p><p>We can easily use Docker to apply Continuous Integration (CI) and Continuous Deployment (CD), making our life easier and the deployment process faster. If you’re not familiar with CI and CD, this post can help you understand the difference between both: <a href="https://www.atlassian.com/continuous-delivery/ci-vs-ci-vs-cd">https://www.atlassian.com/continuous-delivery/ci-vs-ci-vs-cd</a>.</p><h3>Presentation</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fembed%3Fid%3D1LEzqd2RIKpVsBmxFwkk-ShkhsfIXfDBynkmgJ3lJ9oo%26size%3Dl&amp;display_name=Google+Docs&amp;url=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fd%2F1LEzqd2RIKpVsBmxFwkk-ShkhsfIXfDBynkmgJ3lJ9oo%2Fedit%3Fusp%3Dsharing&amp;image=https%3A%2F%2Flh5.googleusercontent.com%2Fe8S4COz8_nwt1vaCRsUdMhemQH4ux0TeWZPThYgodADg0kV3Bj8QfHiLrrDMcPObKnqEQ69TkGy8Xg%3Dw1200-h630-p&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=google" width="700" height="559" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6592bc95fd2ddf218a0ca4a4d2fe640/href">https://medium.com/media/d6592bc95fd2ddf218a0ca4a4d2fe640/href</a></iframe><h3>References</h3><p><a href="https://medium.com/zero-equals-false/docker-introduction-what-you-need-to-know-to-start-creating-containers-8ffaf064930a">https://medium.com/zero-equals-false/docker-introduction-what-you-need-to-know-to-start-creating-containers-8ffaf064930a</a></p><p><a href="https://www.keycdn.com/blog/docker-tutorial">https://www.keycdn.com/blog/docker-tutorial</a></p><p><a href="https://docs.microsoft.com/en-us/learn/modules/intro-to-docker-containers/3-how-docker-images-work">https://docs.microsoft.com/en-us/learn/modules/intro-to-docker-containers/3-how-docker-images-work</a></p><p>I hope you guys have enjoyed this hands-on tutorial and learned at least the basics of Docker. If you have any questions feel free to contact me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37654c6379ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Introduction — Session 1]]></title>
            <link>https://aurangzaib048.medium.com/docker-introduction-session-1-3d7e649f46da?source=rss-59db3357fc4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d7e649f46da</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[infra]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Rana Aurangzaib]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 07:42:33 GMT</pubDate>
            <atom:updated>2021-08-08T11:21:32.463Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Introduction — Part I</h3><p>You are a developer, and you want to start with Docker?</p><p>You are at the right place to start with Docker. This is the first session of Docker, we will start with the Docker introduction, and after that, we will dive into containerize our first application with Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mNX9V1Vzsb3DFEdo.jpg" /><figcaption>Photo by <a href="https://www.morethanshipping.com/author/sevim/">Sevim Oz</a> on <a href="https://www.morethanshipping.com/">MoreThanShipping</a></figcaption></figure><h4>What is Docker?</h4><p><a href="https://www.docker.com/">Docker</a> is free software developed by Docker Inc. It was introduced to the general public on March 13, 2013, and has become a must in IT development since that day.</p><p>It enables users to create autonomous and isolated environments to launch and deploy their applications. These environments are then called containers.</p><p>Docker also helps you to take away repetitive, mundane configuration tasks. Use throughout the development lifecycle for fast, easy, and portable application development.</p><h4>Going back in time</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XeLoSrnHp4H_fzl" /></figure><p><strong>Traditional deployment era:</strong></p><p>For example, if multiple applications run on a physical server, there can be instances where one application would take up most of the resources, and as a result, the other applications would underperform. A solution for this would be to run each application on a different physical server. But this did not scale as resources were underutilized, and it was expensive for organizations to maintain many physical servers.</p><p><strong>Virtualized deployment era:</strong></p><p>As a solution, virtualization was introduced. It allows you to run multiple Virtual Machines (VMs) on a single physical server’s CPU. Virtualization allows applications to be isolated between VMs and provides a level of security as the information of one application cannot be freely accessed by another application.</p><p><strong>Container deployment era:</strong></p><p>Containers are similar to VMs, but they have relaxed isolation properties to share the Operating System (OS) among the applications. Therefore, containers are considered lightweight. Similar to a VM, a container has its filesystem, CPU, memory, process space, and more. As they are decoupled from the underlying infrastructure, they are portable across clouds and OS distributions.</p><h4>Why use Docker as a developer?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dgkUSR06e8QOgB9f.png" /><figcaption>Photo from <a href="https://www.geeksforgeeks.org/">geekfromgeek</a></figcaption></figure><p>This tool can change a developer’s daily life. To best answer this question, I have written a list of the benefits:</p><ul><li>Docker is fast. Unlike a virtual machine, your application can start in a few seconds and stop just as quickly.</li><li>Docker is multi-platform. You can launch your container on any system.</li><li>Containers can be built and destroyed faster than a virtual machine.</li><li>You keep your workspace clean, as each of your environments will be isolated and, you can delete them at any time without impacting the rest.</li><li>It will be easier to deploy your project on your server to put it online.</li></ul><p><a href="https://medium.com/@aurangzaib048/docker-introduction-part-ii-37654c6379ff">Docker Introduction — Part II</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d7e649f46da" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>