<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saswat Samal</title>
    <description>The latest articles on DEV Community by Saswat Samal (@saswat10).</description>
    <link>https://dev.to/saswat10</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1008442%2F24bf88d0-a586-4a57-ac9f-6e5afaaa26aa.jpeg</url>
      <title>DEV Community: Saswat Samal</title>
      <link>https://dev.to/saswat10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saswat10"/>
    <language>en</language>
    <item>
      <title>Docker: A Beginner's Guide</title>
      <dc:creator>Saswat Samal</dc:creator>
      <pubDate>Fri, 10 Oct 2025 07:44:33 +0000</pubDate>
      <link>https://dev.to/saswat10/docker-a-beginners-guide-1138</link>
      <guid>https://dev.to/saswat10/docker-a-beginners-guide-1138</guid>
      <description>&lt;h2&gt;
  
  
  What is Docker
&lt;/h2&gt;

&lt;p&gt;Docker is a containerization platform for developing, packaging, shipping and running applications. It gives the ability to run an application in an isolated environment called a &lt;strong&gt;container&lt;/strong&gt;.&lt;br&gt;
A developer can define all the requirements in &lt;strong&gt;Dockerfile&lt;/strong&gt; which is then used to build and run &lt;em&gt;images&lt;/em&gt; that defines a &lt;u&gt;&lt;em&gt;docker container&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This ensures that our application can run in environment, regardless of the operating system. (Basically your excuse of it works on my machine won't work &lt;code&gt;¯\_(ツ)_/¯&lt;/code&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use docker and its use cases?
&lt;/h2&gt;

&lt;p&gt;Using docker can help you scale your applications easily. It gives you control over your application. It helps in the proper utilization of resources.&lt;br&gt;
Docker can be used in various scenarios like &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application in devops.&lt;/li&gt;
&lt;li&gt;Improvement in software testing.&lt;/li&gt;
&lt;li&gt;Creation of microservices architecture.
&lt;/li&gt;
&lt;li&gt;Multi environment architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture of Docker &amp;amp; it's working
&lt;/h2&gt;

&lt;p&gt;Docker follows &lt;strong&gt;client-server architecture&lt;/strong&gt;. The docker client interacts with the daemon with help of REST API, which manages the docker containers.&lt;/p&gt;

&lt;p&gt;Docker client and daemon can run on the same system, or they can even remotely connected.&lt;/p&gt;

&lt;p&gt;Another client is &lt;strong&gt;docker compose&lt;/strong&gt;, which we use when we have set of containers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9lsfbxujdq9a3xuvbw3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9lsfbxujdq9a3xuvbw3n.png" alt="Docker Architecture" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Client - &lt;code&gt;docker&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The docker client (&lt;code&gt;docker&lt;/code&gt;) is the primary method of interaction used by users. When we send commands  &lt;code&gt;docker run&lt;/code&gt;, &lt;code&gt;docker pull&lt;/code&gt;, etc, it sends requests to docker daemon(&lt;code&gt;dockerd&lt;/code&gt;) which carries them out. &lt;/p&gt;

&lt;p&gt;One docker client can connect with multiple daemons. &lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Daemon - &lt;code&gt;dockerd&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dockerd&lt;/code&gt; listens for API requests and manages Docker objects such as images, containers, networks, and volumes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Images
&lt;/h3&gt;

&lt;p&gt;Docker images are like a blueprint which are used to build containers. Most often, one image is based on another image, and these images are read only. Hence when we want a custom things, we build upon these base images.&lt;/p&gt;

&lt;p&gt;We can use predefined images from the &lt;strong&gt;Docker Registry&lt;/strong&gt; or we build and add more layers upon those images to make our own custom images. For that we can use a &lt;code&gt;Dockerfile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each instruction in the &lt;code&gt;Dockerfile&lt;/code&gt; makes a layer in the image, and when we rebuild or make changes in the  &lt;code&gt;Dockerfile&lt;/code&gt;, only those layers in the images will be rebuilt which we modified. &lt;em&gt;This feature of docker makes it lightweight, small and fast.&lt;/em&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What are layers in images?&lt;/strong&gt;&lt;br&gt;
Container images are composed of various read only layers. Each of these layers represent a set of filesystem changes made during the image build process. These changes can include adding, modifying, or deleting files and directories. And each layer corresponds to a specific instruction.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Docker Containers
&lt;/h3&gt;

&lt;p&gt;A container is a runnable instance of an image. We can start, stop, run, move or delete a container using the docker API or cli. By default these containers are well isolated from other containers and its host machine.&lt;/p&gt;

&lt;p&gt;For example if I could explain in terms of &lt;strong&gt;OOPs&lt;/strong&gt;(Object Oriented Programming) - then a &lt;code&gt;Docker image&lt;/code&gt; would be similar to a &lt;code&gt;class&lt;/code&gt; and a &lt;code&gt;Docker container&lt;/code&gt; would be instance of the that class, i.e., an &lt;code&gt;object&lt;/code&gt; of that class. &lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Registry
&lt;/h3&gt;

&lt;p&gt;A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker looks for images on Docker Hub by default. You can even run your own private registry.&lt;br&gt;
It's like Github but for images, whereas Github is for code.&lt;/p&gt;

&lt;h2&gt;
  
  
  How are Containers different from Virtual Machines?
&lt;/h2&gt;

&lt;p&gt;Virtual Machines are essentially self contained computer within our physical computer. It has its own resources, hardwares, and network interfaces, all of which is created with the help of &lt;code&gt;Hypervisor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's have a brief comparison between containers and virtual machines:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk5jsevstgrkq0wkuy6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk5jsevstgrkq0wkuy6s.png" alt="Vms vs Containers" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Docker Container&lt;/th&gt;
&lt;th&gt;Virtual Machine&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A container is a isolated process with all files need to run.&lt;/td&gt;
&lt;td&gt;VM is an OS with its own kernel, hardware drivers, programs, applications.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lower disk usage, faster, and low impact on OS&lt;/td&gt;
&lt;td&gt;High impact on OS, slower and higher disk usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Encapsulate a single application&lt;/td&gt;
&lt;td&gt;Encapsulate a whole machine&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Often containers and VMs are used together, e.g., In cloud environment, the machines are VMs and we can run multiple containers in it thus utilizing the resources and reducing costs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's all for now!! In the next post I will try to cover about the various commands used for the interaction with &lt;code&gt;docker-cli&lt;/code&gt; and we'll also deep dive into OCI and OCI runtime.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
