<?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 Saif Sadiq on Medium]]></title>
        <description><![CDATA[Stories by Saif Sadiq on Medium]]></description>
        <link>https://medium.com/@saifsadiq.ss?source=rss-b420e68b2844------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*roRk_rAYla-JG7cojcWrMQ.jpeg</url>
            <title>Stories by Saif Sadiq on Medium</title>
            <link>https://medium.com/@saifsadiq.ss?source=rss-b420e68b2844------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 07:51:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saifsadiq.ss/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[Kaniko Dethroning Docker?]]></title>
            <link>https://medium.com/@saifsadiq.ss/kaniko-dethroning-docker-3f142bb07dc8?source=rss-b420e68b2844------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f142bb07dc8</guid>
            <dc:creator><![CDATA[Saif Sadiq]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 14:08:09 GMT</pubDate>
            <atom:updated>2022-09-17T14:08:09.573Z</atom:updated>
            <content:encoded><![CDATA[<p>For the past couple of weeks, I have been learning about Virtual Machines (VMs), Containers, Docker, Kubernetes, and Kaniko. Explained below are my findings and why I believe … Kaniko is the next king in the world of container creation.</p><p>Let’s begin from the basics while highlighting differences between technologies.</p><h3><strong>VMs vs Containers</strong></h3><p>VMs were introduced by IBM back in 1972. But, it was only until the early 2000s that virtualisation became popular. Where as for Containers, they first emerged back in 2013. The year Docker emerged!</p><p>A key difference is the level at which these two technologies perform virtualisation within a computer system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*lCPSgx-ASdZZuqpHNlOwrA.png" /><figcaption>Illustration of the levels that VM and Container use in a computer system.</figcaption></figure><p>VMs are called “Hardware Virtualisation”, because it happens at the hardware level. And on top it we have the <strong>Hypervisor</strong>. This Hypervisor is what creates virtualised instances of each of the components that make up our machine. Hence, taking up our system’s hardware resources (Network, Processors, Storage, RAM etc.) for each individual virtualised machine created.</p><p>For Containers, we again start at the Hardware level. But, building up differently. Kernel sits on top of the Hardware layer (responsible for communication between software and hardware) and on top of that we have our system’s Operating System running. Often times this is called the “Host OS” as well because all containers made are handled and hosted by the Operating System.</p><p>You may notice the disadvantage of VM already, the concept lies with the type of isolation we are achieving. VM gives us “<strong>Hardware Isolation</strong>” meaning all machines created are relatively independent of each other while taking up the system’s resources. Therefore, a lot time is wasted just configuring the OS and Applications for each of the machines! Not to mention the requirement for an expert is needed before hand.</p><p>Where as with Containers, we achieve “<strong>Process Isolation</strong>”. Meaning that although the containers use the same OS and kernel, it appears to themselves that they have their own lightweight OS with necessary installed libraries within them individually. Hence, we can run multiple containers side by side and they even know about each other’s existence. As a result of this type of isolation, we eliminate the fear of system’s processes interfering or OS overlapping with any of the container’s running application.</p><p>The two major features of the kernel that allow this process isolation illusion is done by the <strong>namespace </strong>and<strong> control group </strong>(<strong>cgroup).</strong></p><p><em>Namespace:</em> Responsible for isolating the containers while also giving them the appearance of having their own OS.</p><p><em>Cgroup:</em> Responsible for monitoring and limiting system’s resources to make sure we never tax our system with containers. In other words, control over what exactly we’re giving a container access or control of.</p><p>But, how are containers made? Here comes Docker.</p><h3>Docker &amp; Kubernetes</h3><p>Docker is a SAAS product/tool which primarily creates and manages containers using OS virtualisation. The most important part provided by Docker is the “Docker file”. In which we describe the five customisable layers in order to achieve required behaviour from a container.</p><p>This file is first used to create an “Image”. A Docker Image acts as a template or set of instructions to build a Docker Container. Docker Container is the running instance of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*ZaHtgG1dMPgZ_l5C6zw4qQ.png" /><figcaption>Docker Container creation work flow</figcaption></figure><p>Now that you have your Container up and running. It’s time to deploy it; and Kubenetes your way to go.</p><p>Kubernetes is an open source system where containers are deployed and can be scaled into multiple other copies of itself. Here’s a simple example. <em>Example num1:</em> suppose Amazon Web Server (AWS) has their backend made and run on a container which was later deployed via Kubenetes. And over the weekend, their number of users increase by triple. AWS would then scale up their container into several copies so that the user workload can he handled while ensuring the backend servers keep on running.</p><p>Now that we have a good understanding on Docker and Container. Let’s now move onto the fun part.</p><h3>Kaniko</h3><p>There’s two reasons why we can say Kaniko is dethroning Docker as the prime container creating tool.</p><ol><li><strong>Kubernetes has already dropped Docker support!</strong></li></ol><p>When a Docker Engine is ran on a Kubernetes working node, Docker Engine comes with three components. The CLI, API, and Server. The Server itself is made by several components as well. These are the Container Runtime, Volumes, Network, and to building images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*ofJIaAyntOLBLy6Czpu1Vw.png" /></figure><p>However, in order for a container to run on a Kubernetes node; all it needs is the Container Runtime only! This is because Kubernetes already has features which it can use instead of the ones provided by Docker. Theses are K8s CLI, K8s Volumes, and K8s Network. Furthermore, creation of images is not required in Kubernetes when running a container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*MNViUqjcc-boz4KG-6yIYg.png" /></figure><p>In order to achieve this, Kubernetes primarily removed “<strong>dockershim</strong>”. This was code in Kubernetes that allowed communication with Docker.</p><p>Alternatives for Container Runtime is the “<strong>containerd</strong>”. This was initially as part of Docker Daemon but was later extracted as a separate component; which Kubernetes now uses.</p><p>Thus, this helps us save a lot of resources such as CPU, RAM, and Storage due to requirement of less installations and as well as better security due to less components being involved.</p><p>Speaking of Security … here’s the second pointer.</p><p>2. <strong>No more access to the root!</strong></p><p>This is the main leverage Kaniko has over Docker.</p><p>When using Docker, there are two processes that are running in a container. One being the application processes itself. The second being root processes. This is because Docker Daemon has full access to the internals of the system. Hence, this is a huge risk as the system’s OS is vulnerable now!</p><p>Supposing <em>Example 1 </em>again. If a user gets hold of an AWS container, and somehow breaks the container’s OS; then technically they can break the whole system or steal information such asAWS’s database! Kaniko saves us from this security risk as it restricts access to root.</p><p>Kaniko requires three arguments:</p><ol><li>A Docker file</li><li>Build Context</li><li>Name of registry</li></ol><p>Kaniko executes a set number of instructions on each of the “stages” / “layers” of a provided Docker file in order to generate and image. All PATHs or URLs of reference-able files are defined in the Build Context. And finally, after an image is created, it is pushed into the provided registry’s name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f6tAH_VEYIAXn4XMiZTJeg.png" /></figure><p>Source: <a href="https://cloud.google.com/blog/products/containers-kubernetes/introducing-kaniko-build-container-images-in-kubernetes-and-google-container-builder-even-without-root-access">Introducing kaniko: Build container images in Kubernetes and Google Container Builder without privileges</a></p><p>The reason why Kaniko does not require privileged root access is because all execution and file handling is performed in user space. Hence, Docker Daemon doesn’t gets involved either.</p><h4>Summary and Key takeaways:</h4><ul><li>VM is isolation of machines, while Containers is isolation of processes.</li><li>Namespace<strong> </strong>and<strong> </strong>Cgroup are features existing on the Kernel to make Process Isolations happen.</li><li>Docker is what helps create containers. While Kubernetes is what helps deploying and scaling them.</li><li>Dockershim has been removed from Kubernetes. Therefore, support for Docker on Kubernetes becomes deprecated.</li><li>ContainerD is the container runtime Kubernetes requires in order to make and run containers.</li><li>Kaniko does not require privileged root access where as Docker does.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f142bb07dc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>