<?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 AbdErrazak KENNICHE on Medium]]></title>
        <description><![CDATA[Stories by AbdErrazak KENNICHE on Medium]]></description>
        <link>https://medium.com/@razken-hash?source=rss-e74ec25fd53d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gSvuqyFnQo8rLxLWF-Qm4w.png</url>
            <title>Stories by AbdErrazak KENNICHE on Medium</title>
            <link>https://medium.com/@razken-hash?source=rss-e74ec25fd53d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:21:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@razken-hash/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 Base Images Explained: A Comprehensive Guide — Part I]]></title>
            <link>https://razken-hash.medium.com/docker-base-images-explained-a-comprehensive-guide-part-i-9c88c58c2dc2?source=rss-e74ec25fd53d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c88c58c2dc2</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <dc:creator><![CDATA[AbdErrazak KENNICHE]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 10:30:16 GMT</pubDate>
            <atom:updated>2026-10-08T10:38:20.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ieHNdP_kbLkwKsuGk9ICkg.png" /></figure><p>You’ve probably seen this line countless times in Dockerfiles for Node.js applications:</p><pre>FROM node:24</pre><p>But do we really need node:24 every time we build a Node.js application?</p><p>Maybe not.</p><p>There are smaller and more minimal images that can provide faster image pulls, smaller deployments, and fewer components to maintain.</p><p>But smaller images also come with trade-offs — particularly when it comes to compatibility, debugging, and developer experience.</p><p>And that leads to a more interesting question:</p><blockquote><strong><em>Are smaller Docker images actually better?</em></strong></blockquote><p>In this three-part article, we’ll explore the different types of Docker base images — from <strong>Full</strong>, <strong>Slim</strong>, and <strong>Alpine</strong> to <strong>Distroless</strong> and <strong>Scratch</strong>. We’ll examine what each image provides, when it makes sense to use it, and what you give up as you move toward a more minimal environment.</p><p>In <strong>Part I — OS-Based Images, </strong>we’ll cover <strong>Full</strong>, <strong>Slim</strong>, and <strong>Alpine</strong> images. We’ll look at the Linux environment behind each image, what components it provides, and the trade-offs between size, compatibility, and convenience.</p><p>In <strong>Part II — Minimal Images</strong>, we’ll move beyond traditional OS-based images and explore <strong>Distroless</strong> and <strong>Scratch</strong>. We’ll see how these approaches remove most, or even all, of the traditional operating-system userspace and what that means for application compatibility, security, and debugging.</p><p>Finally in <strong>Part III — Comparison &amp; Benchmarking</strong>, we’ll bring everything together with a <strong>comparison table</strong> covering all five image types. We’ll then put them to the test through a <strong>concrete benchmarking exercise</strong>, measuring metrics such as <strong>image size, build time, startup time, and other relevant performance indicators</strong>.</p><p>More importantly, we’ll approach the decision from a <strong>software engineer’s perspective</strong>. The goal isn’t simply to find the smallest image possible, but to answer a more useful question:</p><blockquote><strong><em>“What is the minimum environment my application actually needs?”</em></strong></blockquote><h3>What Is a Docker Base Image?</h3><p>Before comparing different image types, let’s first understand what a <strong>Docker base image</strong> actually is.</p><p>When you write:</p><pre>FROM node:24</pre><p>you are telling Docker where to start building your image.</p><p>A base image provides the filesystem, libraries, and other foundational components from which the rest of your image is built, including an application runtime when one is provided.</p><p>In the case of node:24, it provides the Node.js runtime together with the underlying userspace and dependencies required to run your application.</p><p>From there, your Dockerfile adds everything your application needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FL0XZIZDCYCjzqn5_L9pSw.png" /></figure><p>But here’s where things get interesting:</p><blockquote><strong><em>Not every application needs the same amount of stuff in its base image.</em></strong></blockquote><p>A <strong>development environment</strong> might benefit from a shell, package manager, debugging utilities, and other tools. A <strong>production container</strong>, on the other hand, may only need the runtime and the libraries required to execute the application.</p><p>This is where different types of base images come into play.</p><p>For the purposes of this article, we can roughly classify common Docker base images into two broad groups:</p><ul><li><strong>OS-based images</strong> provide a Linux userspace and typically include tools such as a shell and package manager. This category includes: Full, Slim and Alpine variants.</li><li><strong>Minimal images</strong> take a more aggressive approach by removing most or all of the traditional userspace. This includes Distroless images and Scratch.</li></ul><p>This is not a strict or universally defined classification, but it provides a useful way to compare how much of the surrounding environment each type provides for an application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qHXYXQIxETi-TrQjgKWQg.png" /></figure><p>These image types generally move toward smaller and more minimal runtime environments, but they are not simply successive stripped-down versions of one another. Each approach makes different trade-offs between image size, compatibility, tooling, and convenience.</p><p>The more minimal the image becomes, the more we need to think about <strong>what our application actually requires at runtime</strong>.</p><p>In the next sections, we’ll explore the three types of OS-based images individually, looking at what they contain, what they leave out, and most importantly, <strong>when each one makes sense.</strong></p><h3>1. Full Images</h3><p>A <strong>Full image</strong> is a general-purpose base image that provides a relatively complete Linux userspace together with the runtime required by your application.</p><p>For example, a Node.js application might start with:</p><pre>FROM node:24</pre><p>Compared with more minimal images, a <strong>Full image</strong> retains a broader set of system tools and utilities, making the container easier to develop, inspect, and troubleshoot.</p><p>It typically includes:</p><ul><li><strong>Relatively complete Linux userspace</strong></li><li><strong>System libraries, shell, </strong>and<strong> common utilities</strong></li><li><strong>OS package manager</strong> (such as apt on Debian/Ubuntu-based images)</li><li><strong>Application runtime</strong> (Node.js for example) and its associated <strong>package manager</strong> (npm, for example)</li></ul><p>In the case of a Node.js image, you can expect the Node.js runtime together with an underlying Debian-based environment and its associated system libraries and utilities.</p><p>This makes the container feel much more like a traditional Linux environment. You can open an interactive shell with:</p><pre>docker exec -it my-app sh</pre><p>From there, you can use familiar tools to inspect files, check processes, examine logs, install packages, or troubleshoot issues directly inside the container.</p><h3>Advantages</h3><p>The main advantage of a <strong>Full image</strong> is <strong>convenience</strong>. It provides a familiar and well-equipped environment with most of the components developers typically need.</p><ul><li>Familiar Linux environment with broad compatibility for applications and dependencies</li><li>Convenient interactive debugging and troubleshooting</li><li>Easy installation of additional packages and tools</li><li>Fewer compatibility issues when applications expect standard system components</li></ul><h3>Disadvantages</h3><p>That convenience comes at a cost. Including a large set of system components and utilities can make the image heavier than necessary for production.</p><ul><li><strong>Larger image size</strong>, resulting in more data to transfer and potentially longer build, push, and pull times</li><li><strong>More unnecessary packages and components</strong> to maintain and potentially update</li><li><strong>Potentially larger attack surface</strong> due to the presence of additional components</li></ul><p>In other words, a <strong>Full image</strong> gives you a comfortable and flexible environment, but you may end up shipping — and maintaining — far more than your application actually needs.</p><h3>Best Use Cases</h3><p>Full images are particularly well suited for:</p><ul><li><strong>Local development</strong></li><li><strong>Debugging and troubleshooting</strong></li><li>Applications with <strong>complex system dependencies</strong></li><li>Applications where <strong>compatibility is a priority</strong></li><li>Situations where the required runtime dependencies are <strong>not yet fully understood</strong></li></ul><p>They provide a comfortable and flexible environment while you’re building, testing, and troubleshooting your application.</p><p>In production, a Full image can still be a reasonable choice when you <strong>need the flexibility of a relatively complete Linux environment</strong> or when the convenience of having common tools readily available outweighs the benefits of a smaller image.</p><p>However, once your application’s dependencies are well understood, many of these additional components may no longer be necessary.</p><p>That raises the next question:</p><blockquote><strong><em>What if we keep the compatibility and convenience, but remove some of the unnecessary components?</em></strong></blockquote><p>That’s where <strong>Slim images</strong> come in.</p><h3>2. Slim Images</h3><p>A <strong>Slim image</strong> is a reduced variant of a Full image. It keeps the core components needed to run the application while removing many packages, tools, and files that are not required at runtime.</p><p>For example, instead of FROM node:24, you can use:</p><pre>FROM node:24-slim</pre><p>The idea is simple:<strong> Keep the runtime and what it needs, remove as much unnecessary baggage as possible.</strong></p><p>A <strong>Slim image</strong> typically contains:</p><ul><li><strong>Reduced Linux userspace</strong></li><li><strong>Essential system libraries and utilities</strong>, with many development and debugging tools removed</li><li><strong>OS package manager</strong> such as apt on Debian/Ubuntu-based images</li><li><strong>Application runtime</strong> (Node.js for example) and its associated <strong>package manager</strong> (npm, for example)</li></ul><p>Compared with a <strong>Full image</strong>, a Slim image contains significantly fewer packages and utilities, resulting in a smaller image size while retaining the essential components needed to run the application.</p><p>Unlike smaller image types, a <strong>Slim image</strong> still provides a conventional Linux environment. It typically includes a shell and the distribution’s package manager, making it easier to inspect, troubleshoot, and install additional packages when needed.</p><h3>Advantages</h3><p>The main advantage of Slim images is that they provide a <strong>balance between size and convenience</strong>.</p><ul><li><strong>Smaller image size</strong>, resulting in faster image transfers</li><li>Familiar Linux-based environment with fewer unnecessary packages</li><li><strong>Smaller attack surface</strong> than a Full image</li><li>Generally easier to debug than other minimal images</li><li>Good compatibility with applications expecting a traditional Linux userspace</li></ul><h3>Disadvantages</h3><p>Slim images are still not minimal.</p><ul><li>Larger than Alpine or Distroless images in many cases</li><li>Still contain more runtime system utilities than highly minimal images</li><li>More packages to maintain than other minimal images</li><li>The exact size and contents depend on the underlying distribution and runtime</li></ul><p>So while Slim removes a lot of unnecessary components, it doesn’t try to remove <strong>everything</strong> that isn’t strictly required by the application.</p><h3>Best Use Cases</h3><p>Slim images are particularly useful when you want to <strong>reduce the size and attack surface of a Full image without giving up the convenience of a traditional Linux environment</strong>.</p><p>They are well suited for:</p><ul><li><strong>Production applications where compatibility matters</strong></li><li>Applications that still need a <strong>conventional Linux environment</strong></li><li>Applications with dependencies that are too complex for a highly minimal runtime</li><li>Teams looking for a <strong>middle ground between Full and more minimal images</strong></li><li>Applications where <strong>debugging inside the container</strong> is still important</li></ul><p>A Slim image is often a practical first step when optimizing an existing Docker image. It allows you to remove many unnecessary components while retaining a familiar environment and broad compatibility.</p><p>In other words, you might think:</p><blockquote>“I don’t need everything in the Full image, but I still want a normal Linux environment.”</blockquote><p>But what if we want to go even further?</p><p>Instead of simply removing packages from a traditional distribution, what if we start with a Linux distribution designed to be small from the beginning?</p><p>That’s where <strong>Alpine images</strong> come in.</p><h3>3. Alpine Images</h3><p><strong>Alpine Linux</strong> is a lightweight Linux distribution designed with simplicity, security, and small size in mind.</p><p>Docker provides Alpine-based variants for many popular runtimes. For example:</p><pre>FROM node:24-alpine</pre><p>The important distinction between <strong>Slim</strong> and <strong>Alpine</strong> is not simply how much software they contain, but <strong>what Linux distribution they are built on</strong>.</p><p>A Full or Slim image is typically based on a conventional Linux distribution such as <a href="https://www.debian.org/">Debian</a>, <a href="https://ubuntu.com/">Ubuntu</a>. However, <strong>Alpine is different:</strong> it’s built directly on <a href="https://alpinelinux.org/">Alpine Linux</a> itself, rather than on Debian or Ubuntu, or another conventional distribution.</p><p>An Alpine-based image typically provides:</p><ul><li><strong>Alpine Linux userspace</strong></li><li><strong>musl libc</strong> instead of <strong>glibc</strong>, commonly used by Debian and Ubuntu</li><li><strong>BusyBox utilities</strong> for common Unix commands</li><li><strong>apk package manager</strong> instead of apt</li><li><strong>Shell and essential system utilities</strong></li><li><strong>Application runtime (</strong>for example Node.js)</li></ul><h3>Advantages</h3><p>The main advantage of Alpine is its <strong>small footprint while still providing a functional, general-purpose Linux environment</strong>.</p><ul><li><strong>Small image size</strong>, resulting in faster image pulls, transfers, and deployments</li><li><strong>Lightweight package management</strong> through apk, along with a shell and essential utilities</li><li><strong>Minimal by design</strong>, with fewer components included by default and a smaller attack surface</li><li><strong>Wide ecosystem</strong> of official and community-maintained Alpine-based images</li><li><strong>Suitable for many production workloads</strong> where a lightweight Linux environment is sufficient</li></ul><p>It therefore provides an interesting middle ground:</p><blockquote><strong><em>Much smaller than a Full image, while still giving you a usable Linux environment.</em></strong></blockquote><h3>Disadvantages</h3><p>The biggest consideration with Alpine is <strong>compatibility</strong>.</p><p>Alpine uses <strong>musl libc</strong>, while distributions such as Debian and Ubuntu generally use <strong>glibc</strong>.</p><p>This difference can cause problems with applications or dependencies that expect glibc or rely on precompiled native binaries.</p><p>For example, issues can arise with:</p><ul><li>Native Node.js modules</li><li>C/C++ libraries</li><li>Precompiled binaries</li><li>Language packages with native extensions</li><li>Third-party software that assumes a glibc-based environment</li></ul><p>In some cases, additional compatibility packages may be required, which can partially offset the benefits of choosing Alpine in the first place.</p><p>So the important lesson is:</p><blockquote><strong><em>Small does not automatically mean compatible.</em></strong></blockquote><h3>Best Use Cases</h3><p>Alpine is particularly well suited for:</p><ul><li><strong>Applications that are compatible with musl</strong></li><li><strong>Lightweight production services</strong></li><li><strong>Microservices architectures</strong></li><li><strong>Applications where image size and transfer time are important</strong></li><li><strong>Workloads that still benefit from having a shell and package manager</strong></li><li><strong>Teams comfortable managing Alpine-specific dependencies</strong></li></ul><p>Use Alpine when you want a <strong>small, general-purpose Linux environment</strong> and you have verified that your application and its dependencies work correctly with musl.</p><p>If your application works well on Alpine, it can be an excellent choice for reducing image size while retaining a functional Linux environment.</p><p>However, if you start spending more time solving compatibility issues than benefiting from the smaller image, a <strong>Slim or another glibc-based image</strong> may be a more practical choice.</p><p>At this point, an even more fundamental question arises:</p><blockquote><strong><em>Do we actually need a Linux distribution at all?</em></strong></blockquote><p>What if we remove the shell, package manager, and most of the userspace, keeping only what the application needs to run?</p><p>That’s the idea behind <strong>minimal images</strong>, which we’ll explore in Part II.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c88c58c2dc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>