<?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 Cristovao Cordeiro on Medium]]></title>
        <description><![CDATA[Stories by Cristovao Cordeiro on Medium]]></description>
        <link>https://medium.com/@cristovaocordeiro?source=rss-55e98c0205d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z22Wr8H1voxC2Ze25qwJ4Q.png</url>
            <title>Stories by Cristovao Cordeiro on Medium</title>
            <link>https://medium.com/@cristovaocordeiro?source=rss-55e98c0205d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:15:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cristovaocordeiro/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[The Book of Container Myths]]></title>
            <link>https://levelup.gitconnected.com/the-book-of-container-myths-e70a78e79df7?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e70a78e79df7</guid>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker-container]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 12:13:58 GMT</pubDate>
            <atom:updated>2026-07-15T14:09:54.118Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>⚠️ Disclaimer:</strong> This article contains facts about Docker containers. Some beliefs you hold dear may be challenged, gently debunked, or — in extreme cases — shattered entirely. Reader discretion is advised.</blockquote><p>I’ve been developing and using containers for many years now. I have seen tools come and go, ideas hatch and die, and myths calcify into gospel — repeated so often and so confidently that they stopped being questioned. This is my attempt to challenge them.</p><p>And don’t get me wrong — I’ve been complicit in spreading these dogmas, too. I’ve parroted them, shipped them, and defended them in situations where I shouldn’t have. But hey, what matters is that we keep evolving and ensure our containerization practices aren’t driven by dogmatic fallacies. To quote a great philosopher: “Fool me once, strike one. But fool me twice… strike three”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydSEpkQXByHJIaJ9Q6elwQ.png" /><figcaption>AI-generated image</figcaption></figure><h3>Myth I: Thou Shalt Have One Process Per Container</h3><blockquote><strong>Why, oh why</strong> did we mistake a process count for a design principle?</blockquote><p>This is the one I hear the most, and it’s a bastardized interpretation of a more nuanced container concept — “<em>function isolation</em>”. A rigid rule, turned into a developer myth, that often leads to fragile, overly complex, and difficult-to-maintain container stacks.</p><p>I’m less triggered when I hear “one service per container”, because it’s less mechanical and closer to the functional concept, but still…</p><p><strong>Building by function</strong> aligns much better with how applications actually work. Sometimes the application needs helpers, or maybe has an adjacent component whose lifecycle is fully dependent on the application’s main process.</p><p>The funny thing is — developers actually <em>try</em> to containerize by function. The paradox is the ideology vs implementation — they design a container that follows the “one process per container” myth by creating a simple wrapper script as the entrypoint (commonly referred to as entrypoint.sh), and this script is equipped with some basic logic that allows the container to be started with the right application helpers and sometimes even toggle between application binaries, depending on the container’s runtime arguments.</p><p>Don’t get me wrong — my beef is not with the entrypoint.sh script itself, but rather with the frequent over-engineered and brittle adoption of this script for containers that are more complex than your typical single-binary application.</p><p>You — the developer — need to <strong>understand the application</strong> you’re about to containerize. In many (I’d say most) cases, you’ll want to treat every process inside your container as a manageable and traceable unit. That includes being able to monitor each individual process, support multiple child processes, as well as reaping, signal and log forwarding, and graceful shutdowns. You see where I’m going with this…<strong><em>use a process manager as the container’s init system (PID 1)</em></strong>!</p><p>By “process manager” I’m not referring to a rudimentary transformation of the entrypoint.shscript into a <a href="https://docs.docker.com/engine/containers/multi-service_container/#use-bash-job-controls">controller of Bash jobs</a>. Instead, you’ll find existing tools that have been specifically designed to act as the container’s PID 1 and as a process supervisor.</p><p>From minimal PID 1-specific tools like <a href="https://github.com/krallin/tini">tini</a> (natively supported by Docker and others like it, via docker run — init …), to container-optimised lightweight service managers like <a href="https://github.com/just-containers/s6-overlay">s6-overlay</a> and <a href="https://documentation.ubuntu.com/pebble/">pebble</a> that provide features like:</p><ul><li>declarative definition of services,</li><li>support for multiple child processes,</li><li>reaping and subreaping,</li><li>signal forwarding,</li><li>graceful shutdown,</li><li>log rotation and log forwarding.</li></ul><p>If you think about it, the introduction of a common and well-known PID 1 for your containers even brings the advantage of having a predictable and consistent UX across your entire container stack for typical image inspection and container management operations (e.g. describing the container services, defining health checks, getting individual logs, etc.).</p><p><strong>TLDR:</strong></p><ul><li>Don’t obsess over process count — design containers by <strong>function</strong>, not by process.</li><li>Complex containers benefit from a proper <strong>init system</strong> (PID 1) — not a brittle entrypoint.sh.</li><li>Tools like tini, s6-overlay, and pebble give you process supervision, signal forwarding, reaping, and graceful shutdown out of the box.</li><li>A shared PID 1 across your container stack brings <strong>consistency</strong> and predictability.</li></ul><h3>Myth II: Thou Shalt Trust Distroless Images</h3><blockquote><strong>Why, oh why</strong> did we start measuring container quality in megabytes?</blockquote><p>Hey, “<a href="https://github.com/googlecontainertools/distroless">distroless</a>” is great! It is a container concept that I believe has been instrumental in the way developers design their containers. At the same time, it has become one of the biggest <a href="https://www.youtube.com/watch?v=g-jxmQc5ChM">logical fallacies I’ve seen around in the container space</a>, where developers simply appeal to the authority of the distroless nature of their container image and its minimal size, to claim that therefore it is as secure as it can be.</p><p>Well, “the price of greatness is <strong>responsibility</strong>”. Distroless is an architectural design concept that doesn’t remove the need for developers to be disciplined and employ critical thinking while building their containers. And yet, somehow, “it’s distroless” has become the container equivalent of “it’s organic” — slap the label on and stop asking questions. The traditional way of approaching a distroless build is less straightforward than your typical non-distroless one. It normally involves a top-down approach with a multi-stage build where you first bloat a staging environment and then copy the runtime application and dependencies to another stage, with a pristine and <em>scratched</em> environment. Well, so far so good — just because the process is more involved doesn’t mean it cannot produce something great. It absolutely can. But complexity comes with costs and risks:</p><ul><li>Build recipes and processes become more complex and thus harder to maintain (sometimes including specialized tooling)</li><li>There’s typically the need to have more distro expertise in order to go distroless 😛</li><li>Top-down builds often mean cherry-picking the contents for the final container image, which is, in my opinion, an error-prone process that may lead to the existence of <strong>CVE False Negatives</strong> — and this is my main gripe.</li></ul><p>Being small and distroless isn’t all it takes to have a secure image. I honestly believe that not knowing about a security vulnerability is MUCH worse than being flagged for one that actually doesn’t exist (i.e. False Positive) or even having a real one. The bottom line is that all containers <strong>MUST be auditable</strong>!</p><p>Believe it or not, most container scanners rely on information that is inside the container in order to infer what’s inside and use that to find where your container may be vulnerable. In other words, if you manually delete your image’s dpkg metadata, your scanner may find <em>Zero Packages</em> and thus report <em>Zero Vulnerabilities</em> — great! Your CVE report is all green now… 😒</p><p>🠮 These are CVE False <strong>Negatives</strong>, and they are dangerous! You can’t take precautions against risks you don’t know about.</p><p>Just imagine if this were a medical report. I’m sure you’d much rather be told <em>“hey, it was a false positive! you’re all good 👍”</em> than <em>“I’m really sorry but our scanners missed a spot and actually it turns out you have Caffeine-Induced Jitter Buffer Overflow”</em>.</p><p>Now, one of the main reasons why False Negatives happen is because during the process of building a distroless image, developers leave behind important package metadata that the scanners rely on for finding CVEs. And most times they don’t do it intentionally. Typically, the package manager is responsible for managing such metadata, but the traditional top-down distroless builds don’t rely on package managers to prime the desired software into the final image. And that’s a problem — <em>the inability to detect software components not managed by package managers</em>.</p><p>So what’s the takeaway? Well, if most scanners are designed to rely on distro-specific data, then you gotta carry that information when creating distroless images. You gotta have <strong>discipline</strong>. There are tools out there that will behave like a package manager for distroless filesystems, and thus ensure your image is shipped with the necessary metadata for it to be auditable. For example, <a href="https://documentation.ubuntu.com/chisel/">Chisel</a> — *shameless plug* — allows you to generate minimal, application-centric, slices of an Ubuntu filesystem, from the ground-up, while also generating a <a href="https://ubuntu.com/chisel/docs/latest/reference/manifest/">manifest</a> file with all the metadata required for a scanner to detect the software inside (e.g. <a href="https://canonical.com/blog/canonical-partners-with-snyk-for-scanning-chiseled-ubuntu-containers">snyk container test &lt;chiseled-image&gt;</a>).</p><p><strong>TLDR:</strong></p><ul><li>Distroless is a <strong>design concept</strong>, not a security guarantee.</li><li>Small image size ≠ secure image. All containers <strong>must be auditable</strong>.</li><li>CVE False Negatives (missed vulnerabilities) are far more dangerous than False Positives.</li><li>Traditional top-down distroless builds often strip package metadata that scanners need.</li><li>Use tools that preserve metadata (e.g. Chisel) so your images can be scanned.</li></ul><h3>Myth III: Thou Shalt Always Roll With The Latest</h3><blockquote><strong>Why, oh why</strong> isn’t stability a de-facto standard for container tags?</blockquote><p>Somewhat related to the previous “Cult of the Green CVE Dashboard” myth, there is this tendency for users to follow OCI tags that move really fast, usually alongside the upstream, without any sense of stability.</p><p>I am not strictly talking about the usual suspect — the latest tag — but rather about the inherent obscurity behind the stability associated with any given floating reference (aka OCI tag).</p><p>’Cause guess what, depending on the underlying release channel a latest tag refers to, I might accept it for non-production environments!</p><pre>+------------------------------+------------------------------+----------------------------------+<br>| &quot;latest&quot; Definition Strategy | Example                      | Acceptable?                      |<br>+==============================+==============================+==================================+<br>| **Latest Stable Release**    | The most recent official,    | ✅ **but**,                      |<br>|                              | generally available (GA)     | while this ensures users pulling |<br>|                              | release (e.g., updated from  | this tag receive the most        |<br>|                              | `v1.2.3` to `v1.2.4`).       | recent, production-ready, and    |<br>|                              |                              | fully tested version of the      |<br>|                              |                              | software, it also allows for new |<br>|                              |                              | major (and potentially           |<br>|                              |                              | disruptive) versions of the      |<br>|                              |                              | software to be introduced        |<br>|                              |                              | unwittingly.                     |<br>+------------------------------+------------------------------+----------------------------------+<br>| **LTS Rolling**              | The newest release of the    | ✅ **but**,                      |<br>|                              | currently supported Long     | it is similar to the above. We   |<br>|                              | Term Support (LTS) track,    | can say it is more stable, since |<br>|                              | even if a newer major        | it may skip major versions that  |<br>|                              | version exists (e.g.,        | will stop receiving updates in   |<br>|                              | pointing to `v18.x.x` even   | the near future. But still not   |<br>|                              | when `v20.x.x` is out).      | to be taken lightly.             |<br>+------------------------------+------------------------------+----------------------------------+<br>| **Continuous / Bleeding      | Every single merge or commit | ⛔                                |<br>| Edge**                       | to the default branch        | This is like playing Russian     |<br>|                              | (`main` or `master`).        | Roulette with your working       |<br>|                              |                              | environment. Highly unstable.    |<br>|                              |                              | Users pulling this tag are       |<br>|                              |                              | exposed to untested code,        |<br>|                              |                              | mid-feature commits, and         |<br>|                              |                              | unpredictable breaking changes.  |<br>|                              |                              | For clarity, many maintainers    |<br>|                              |                              | often refer to this as the       |<br>|                              |                              | `edge` tag (which I prefer,      |<br>|                              |                              | because it conveys the           |<br>|                              |                              | *stability* level).              |<br>+------------------------------+------------------------------+----------------------------------+<br>| **Scheduled / Nightly        | An automated build           | ⛔                                |<br>| Build**                      | generated at a specific time | It is unacceptable for the same  |<br>|                              | interval (e.g., midnight)    | reasons as the bleeding-edge     |<br>|                              | capturing the current        | strategy. This (often called     |<br>|                              | development state.           | `nightly`) tag violates the      |<br>|                              |                              | principle of least surprise,     |<br>|                              |                              | even if potentially introducing  |<br>|                              |                              | edge changes less regularly than |<br>|                              |                              | `edge`.                          |<br>+------------------------------+------------------------------+----------------------------------+</pre><p>It seems like I’m focusing on the latest tag, but in reality this applies to any floating tag, even if the tag is pinning a version! And this is the controversial part 😈…</p><blockquote>the 1.0.x tag is better than latest</blockquote><p>Yes, absolutely. But if you think about it, that pinned tag isn’t actually pinned (for that you’d use digests). It’s still a floating tag, simply referring to a narrower stream of releases, still with <strong>no concept of stability</strong>.</p><p>Users who defend the stability and security of a 1.0.x tag often use the argument of “semantic versioning acting as an implicit public contract between developers and users”. <strong>But</strong>, think about it, “newer” isn’t always “safer”: when you pull a new version of a vulnerable image, you aren’t just pulling the CVE fix — you are pulling lines of code, patches, that relate to small refactors and bug fixes. And with each line of code, there’s an <strong>inherent risk</strong> — so, not only are you <em>trusting</em> developers to follow the semantic versioning contract to the letter, you are also trading a known CVE for a potentially unknown, undiscovered, and unfixed vulnerability.</p><p>This is why <a href="https://ubuntu.com/blog/stability-backports-and-hidden-risks-of-the-bleeding-edge"><strong>CVE backports</strong></a> are employed in many container supply chains (e.g. ubuntu/ images — *yet another shameless plug*). CVE backports are one of the backbones of stability. The image maintainers should not pull every single patch into the 1.0.x tag, but rather focus on rebasing the source with the minimal amount of changes to ensure image security and stability, fixing vulnerabilities without introducing volatility.</p><p>One of the strategies followed by the ubuntu/ Docker images is to tag every image with a notion of “stability” — i.e. tags will have a <em>stability suffix</em>, ranging from _edge to _stable, allowing a new version of the image to be quickly available in _edge, and progressively gain confidence to make its way into _stable without further changes.</p><p><strong>TLDR:</strong></p><ul><li>Most floating tags — even those like 1.0.x — miss a built-in guarantee of stability.</li><li>“Newer” isn’t always “safer” — every update trades a known CVE for potentially unknown risks.</li><li><strong>CVE backports</strong> are the backbone of stability: fix vulnerabilities without introducing volatility.</li><li>Look for tags with explicit <strong>stability signals</strong> (e.g. _edge, _stable suffixes).</li></ul><h3>Myth IV: Thou Shalt Label Only Thy Final Containers</h3><blockquote><strong>Why, oh why</strong> is label usage treated as an exclusive privilege of the final application container?</blockquote><p>This one is slightly related to the above, because something I’ve heard before is</p><blockquote>Don’t label <em>base</em> images because then all other derivative ones will inherit their labels, and I can’t unset them</blockquote><p>Again, 😒</p><p>In this case, I see a couple of red flags:</p><ol><li>The definition of “base” and “parent” images shouldn’t, on its own, be the decision-maker for whether an image should have labels or not</li><li>The fact that your tool can’t manipulate labels, doesn’t mean that they cannot be manipulated</li></ol><p>To elaborate on these two things, you must remember that even the so-called “base” images have their own purpose beyond just being a “parent” for downstream builds.</p><p>Labels, by definition, are useful mechanisms for adding metadata to your container image. While one may argue that there is some overlap between labels and the more modern <a href="https://github.com/opencontainers/image-spec/blob/main/annotations.md">OCI annotations</a>, the reality is that these sets of metadata live in different locations inside the OCI archive. Same house, different rooms. As such, in <strong>today’s</strong> state-of-the-art OCI specifications, they still serve different purposes.</p><p>While OCI annotations are much more registry-friendly, labels are still widely used for inspecting images locally and sometimes even for driving custom admission tooling.</p><p>I can see a case to push more strongly towards OCI annotations, and in fact I do this myself. I do favour OCI annotations. But I won’t go to the extent of completely getting rid of labels just yet, and definitely not because they are “hard to unset”. Redefine them in your Dockerfile, write a multi-stage build, use a tool like crane or umoci…the options are there.</p><p><strong>TLDR:</strong></p><ul><li>Use labels if you need them.</li><li>Ensure labels serve a purpose.</li><li>Follow a predictable labelling convention.</li><li>Adopt OCI annotations.</li><li>Expand your tooling and/or build processes to manipulate labels.</li></ul><h3>Myth V: Thou Shalt Settle For Any Non-Root User</h3><blockquote><strong>Why, oh why</strong> aren’t we more disciplined about how non-root images are designed?</blockquote><p>Non-root. Yes. Do it!</p><p>However, don’t just USER 1. Sure it’s non-root, but it’s also not the safest.</p><p>Understand that the goal behind running your containers as non-root is to protect yourself from an eventual container breakout where the malicious root process inside the container emerges onto the host machine with full root privileges. Enabling user namespaces is an extra protection, but employing non-root container users is still the ultimate goal, even from an application design perspective — the principle of least privilege.</p><p>So, what should you consider when making your container non-root?</p><p>It is not just about having a UID != 0. Containers are meant to be portable. Linux distributions evolve, and so do their policies. And while the exact user boundaries may vary slightly depending on the specific Linux distribution and its age, modern Linux systems generally follow a standard convention for allocating UID ranges. As a rule of thumb, <strong>today</strong>, you want to steer away from UID &lt; 1000, as those are typically <a href="https://www.debian.org/doc/debian-policy/ch-opersys.html#uid-and-gid-classes">reserved for root (of course) and system users</a>. This is why you’ll see <a href="https://github.com/search?q=path%3A**%2FDockerfile+%22USER+%22&amp;type=code&amp;ref=advsearch">many Docker images out there</a> where the non-root user is 1000 or 1001.</p><p>If this is already the case for many Docker images, why am I talking about it?</p><p>Well, first, it’s not the case for <strong>all</strong> yet 😛.</p><p>Second, I believe there’s still something to be said about your choice of UID. A UID &gt;= 1000 refers to dynamically allocated user accounts. So it will be quite normal to find such UIDs already existing in your host system. For example, you’ll find Ubuntu instances (especially in cloud environments) where there is an ubuntu user with UID = 1000. So, would it still be safe to set your container user to UID = 1000 as well? Probably not, for the same reasons as before — sure, it’s not root, but it is still an existing host user that you don’t want to compromise.</p><p>So what’s the takeaway?</p><p><strong>Choose a high, non-reserved UID with the lowest probability of collision with the host</strong> (see <a href="https://documentation.ubuntu.com/rockcraft/latest/reference/rockcraft-yaml/#run-user">Rockcraft</a>’s example — *another shameless plug*).</p><p>If you have <a href="https://man7.org/linux/man-pages/man7/user_namespaces.7.html">User Namespaces</a> enabled in Docker/Podman/Kubernetes, you’ll notice this already, since the default subordinate UID ranges go beyond UID 65536.</p><p>As a final remark, to maximize the portability and interoperability of your containers, you also want to be consistent in the choice of UIDs for your containers. Going non-root means there will be complexity regarding file permissions and volume mounts. You will struggle with permission denied errors when the non-root container attempts to access or modify mounted volumes or bind-mounts. This is hard to avoid, and in most cases it is a good thing, requiring you to be more prescriptive about the data management policies for your container deployments. Nonetheless, my suggestion to you is to strive for consistency in your choice of UID across your containers, especially the ones that need to share data.</p><p><strong>TLDR:</strong></p><ul><li>Non-root is essential.</li><li>Avoid UID &lt; 1000 (reserved for root and system users).</li><li>Choose a <strong>high, non-reserved UID</strong> to minimize collision risk with host users.</li><li>Be <strong>consistent</strong> in your UID choices across containers that share data.</li></ul><h3>Myth VI: Thou Shalt Not Embed Image Metadata</h3><blockquote><strong>Why, oh why</strong> is it considered hearsay for a container application to know a little bit about its own image?</blockquote><p>I want to finish with this one because it is actually quite close to me. Many times in the past, I found myself — not always for good reasons (I’ll admit) — trying to implement my container application in a way that it could read information about the image it started from.</p><p>The obvious question is “<em>why would you want that</em>”? At face value, I agree that separation of concerns is needed, and as such I wouldn’t recommend duplicating your <a href="https://github.com/opencontainers/image-spec/blob/main/config.md">OCI config file</a> inside the image layers.</p><p>At the same time, I see value in having <em>some</em> internal metadata shipped alongside your container application, which may potentially be useful for things like enriched observability and debugging capabilities (e.g., app log forwarding with container build info (aka contextual logging)).</p><p>This is actually not so unusual, as you may have already found images where things like /etc/cloud/build.info are set within, with information about the build.</p><p><strong>TLDR:</strong></p><ul><li>Embedding <em>some</em> build metadata inside the image is not heresy — it can enrich observability and debugging.</li><li>Don’t duplicate the full OCI config inside the layers — keep it lightweight and purposeful.</li><li>Patterns like /etc/cloud/build.info already exist in the wild and serve this exact purpose.</li></ul><h3>Closing Note</h3><p>If you’ve made it this far, congratulations — you’ve survived the sermon. These myths aren’t going away overnight, and honestly, some of them will keep being repeated long after this post. That’s fine. The goal was never to be the definitive authority on container best practices, but to get you to pause and question the defaults you’ve been carrying around.</p><p>Challenge your assumptions. Read the docs. Break things in staging. And if you catch me contradicting any of this in a future talk or commit — call me out.</p><p>Now go build something great. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e70a78e79df7" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/the-book-of-container-myths-e70a78e79df7">The Book of Container Myths</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Whole Shebang: Distroless Containers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/the-whole-shebang-distroless-containers-c0729fd71c04?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/1424/1*_6_NyGqeeG1vLcZPGutHDw.png" width="1424"></a></p><p class="medium-feed-snippet">Small and secure&#x200A;&#x2014;&#x200A;that&#x2019;s the goal when building containers. It is a hard craft to master though, so here are a few techniques you can use.</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/the-whole-shebang-distroless-containers-c0729fd71c04?source=rss-55e98c0205d6------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/the-whole-shebang-distroless-containers-c0729fd71c04?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0729fd71c04</guid>
            <category><![CDATA[distroless]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[rockcraft]]></category>
            <category><![CDATA[chisel]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 01:57:23 GMT</pubDate>
            <atom:updated>2025-01-24T01:57:23.546Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Fallacy of Complacent Distroless Containers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/the-fallacy-of-complacent-distroless-containers-8b09bd3ad55a?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/1024/1*BqDVyWJ4PoTrsSc0mup5Aw.jpeg" width="1024"></a></p><p class="medium-feed-snippet">Making containers smaller is the most popular practice when reducing your attack surface. But how real is this sense of security?</p><p class="medium-feed-link"><a href="https://medium.com/data-science/the-fallacy-of-complacent-distroless-containers-8b09bd3ad55a?source=rss-55e98c0205d6------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/the-fallacy-of-complacent-distroless-containers-8b09bd3ad55a?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b09bd3ad55a</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[distroless]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cve]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 18:52:34 GMT</pubDate>
            <atom:updated>2025-01-07T13:48:36.680Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Teeny-weeny containers, with Chisel]]></title>
            <link>https://levelup.gitconnected.com/teeny-weeny-containers-with-chisel-8d9bec38d124?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d9bec38d124</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[chisel]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[distroless]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 02:58:23 GMT</pubDate>
            <atom:updated>2023-11-27T02:58:23.288Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you heard about distroless containers? It sounds tricky and in some cases, it is! I’ll show you how to easily achieve the same end results with Chiselled Ubuntu containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0PPi6pap0x345t9i" /><figcaption>Photo by <a href="https://unsplash.com/@chuttersnap?utm_source=medium&amp;utm_medium=referral">CHUTTERSNAP</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Distroless</h3><p>First things first: <em>what is “Distroless”?</em></p><p>If you’re reading this, you probably are acquainted with containers already. You might even have already pulled a few images from places like Docker Hub, and who knows, you might even have built your own container image (maybe with <a href="https://betterprogramming.pub/the-whole-shebang-dockerfiles-5d59ace94d28">my help</a>?).</p><p>Now tell me: <strong>what do you look for in a container image?</strong> When you pull or build one, what is your selection criteria?</p><p>Well, I’m guessing “size” and “security”, right? Sure you might also look for “provenance” and “stability”, among others, but I think you’d never use an image that is insecure.</p><p>Now, if vulnerabilities are associated with software, the obvious solution is to simply get rid of that software 😎. So that’s it folks…just delete everything. Thanks for reading…</p><p>…just kidding. You obviously need your <strong>application and its runtime dependencies</strong> to be inside the container image. Well, that’s distroless! Quoting <a href="https://github.com/GoogleContainerTools/distroless">Google</a>:</p><blockquote>“Distroless” images c<strong>ontain only your application and its runtime dependencies</strong>. They <strong>do not contain package managers</strong>, <strong>shells</strong> or <strong>any other programs</strong> you would expect to find in a standard Linux distribution.</blockquote><p>What this means is that you’re reducing your container’s attack surface by getting rid of potentially vulnerable software that is useless at runtime.</p><h3>So, what’s the catch?</h3><p>Well, to be fair, this can be a daunting task in some cases. Even worse, if not done properly, distroless container images can actually become a black hole for hidden vulnerabilities, which in my opinion, is even worse than having a visibly vulnerable image!</p><p>Don’t get me wrong, distroless <strong>can be</strong> amazing. However:</p><ul><li>Nowadays practices require either the use of complicated and specialized tooling, or the writing of convoluted Dockerfiles with multiple stages;</li><li>Distroless image builds typically employ a top-down approach, which involves the <strong>manual </strong>cherry-picking of your image’s content onto the final “scratch” base;</li><li>The construction of the final distroless image filesystem does not rely on a package manager, which means it is quite easy to leave out files that are important for post-build operations, like security scanning;</li><li>You need to be quite knowledgeable about distros in order to build a distroless image! I mean, if you’re going to cherry pick your runtime dependencies manually, then you must know about those packages — how they are built, what they contain, what do they depend on, and what parts of it you’ll need.</li></ul><h3>Let there be “Chisel”</h3><p><strong>What is it?<br></strong>Chisel is a standalone tool to sculpt ultra-small Ubuntu file systems, <br>by cutting and carving Debian packages <strong>from the Ubuntu archives</strong>.</p><p><strong>Who maintains it?<br></strong>Canonical! It is meant to provide that familiar Ubuntu user experience.</p><p><strong>Why do you need it?<br></strong>You want to build distroless images in a predictable, consistent and traceable way, and for that, Chisel becomes a sort of package manager for distroless builds.</p><p><strong>When should you use it?<br></strong>Although it isn’t container-specific, you’ll want to use Chisel early during your build process. Tell chisel which packages you need, and from those packages, which “slices” your application depends on. From there, Chisel will take care of constructing a minimal filesystem that you can then copy into a scratch base, alongside your application.</p><p><strong>Where can you find it?<br></strong>Right <a href="https://github.com/canonical/chisel">here</a>.</p><h4>How does it work?</h4><p>Chisel is written in Go and distributed as a standalone binary that you can run pretty much anywhere. But <em>how does Chisel know </em><strong><em>how to carve</em></strong><em> a package?</em></p><p>Well, it all starts with a <a href="https://github.com/canonical/chisel-releases">database of “slices”</a>, which are <strong>organized by Ubuntu release</strong>. <strong>Slices are defined via YAML files, called Slice Definitions Files</strong> (aka SDFs). Very much like Debian packages, <strong>slices have contents</strong> and can also define <strong>installation scripts</strong> and <strong>declare dependencies to other slices</strong>!</p><figure><img alt="An illustration of slices for two different Debian packages, and how they can declare dependencies amongst each other." src="https://cdn-images-1.medium.com/max/482/1*mEzoOx1FbMSGftbJCIX4wQ.png" /><figcaption><a href="https://github.com/canonical/chisel/">https://github.com/canonical/chisel/</a></figcaption></figure><p>Since these slice definitions live in a central place, all one has to do is to run Chisel and ask for the portions (aka slices) for the packages needed at runtime.</p><h3>Enough theory! Here’s an example…</h3><p><strong>Use case: </strong>let’s assume we want to build a <em>(distrolless) </em>Chiselled container image that is capable of running the following app.py Python script:</p><pre>print(&quot;hello world&quot;)</pre><p><strong>Steps:</strong></p><ol><li>Get Chisel!</li></ol><pre># See https://github.com/canonical/chisel/releases for all versions and archs<br>VERSION=v0.8.0<br>ARCH=amd64<br># Feel free to change the VERSION and ARCH according to your preferences<br>wget https://github.com/canonical/chisel/releases/download/${VERSION}/chisel_${VERSION}_linux_${ARCH}.tar.gz -O - | tar -xz</pre><p>2. Prepare the empty root filesystem where to install the slices:</p><pre>mkdir rootfs</pre><p>3. According to the <a href="https://github.com/canonical/chisel-releases">database of slices</a>, there are slice definitions available for Python3.8 on Ubuntu Focal (20.04). So let’s install the smallest slice that would allows us to run our Python script:</p><pre>chisel cut --release ubuntu-20.04 --root rootfs python3.8_core<br># From the output, we can see it will actually install other slices (like libc6) that Python3.8 depends on</pre><p>4. Create the Dockerfile for your Chiselled image:</p><pre>FROM scratch<br>COPY rootfs /<br>COPY app.py /<br>ENTRYPOINT [&quot;/usr/bin/python3.8&quot;, &quot;/app.py&quot;]</pre><p>5. Build it: docker build -t my-app .</p><p>Moment of truth 👀</p><pre>$ docker run --rm my-app<br>hello world</pre><p>Oh yeah! It worked! And guess what:</p><pre>$ docker images my-app<br>REPOSITORY   TAG       IMAGE ID       CREATED         SIZE<br>my-app       latest    6505bd725fb7   2 minutes ago   20.8MB</pre><p><strong>😆 20.8MB, decompressed! </strong>If pushed to a registry, like Docker Hub, this whole image would have ~8MB. And yes…it has a Python interpreter! Don’t believe me? Check it out:</p><pre>$ docker run --rm -it --entrypoint /usr/bin/python3.8 my-app<br>Python 3.8.10 (default, May 26 2023, 14:05:08) <br>[GCC 9.4.0] on linux<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>&gt;&gt;&gt; import os<br>&gt;&gt;&gt; os.listdir(&quot;/&quot;)<br>[&#39;lib64&#39;, &#39;usr&#39;, &#39;etc&#39;, &#39;lib&#39;, &#39;dev&#39;, &#39;proc&#39;, &#39;sys&#39;, &#39;.dockerenv&#39;, &#39;app.py&#39;]<br>&gt;&gt;&gt;</pre><h4>What if…</h4><p><em>The packages you need are not sliced? Or maybe the existing slices aren’t enough for you?</em></p><p>Then the recommend path is to actually become a contributor and suggest your slice definitions via a PR <a href="https://github.com/canonical/chisel-releases">https://github.com/canonical/chisel-releases</a>.</p><p>If you can’t wait for the whole approval process, then <strong>there’s a faster way</strong>! You can actually use local custom Chisel releases! How? Well, start by cloning the branch of the Chisel release you need — e.g.:git clone -b ubuntu-20.04 <a href="https://github.com/canonical/chisel-releases">https://github.com/canonical/chisel-releases</a> custom-release.</p><p>Then you could simply create or add your slice definitions into the local custom-release/slices folder.</p><p>Finally, instead of a branch name, give chisel the path to your local release: chisel cut --release $PWD/custom-release .... And that’s it!</p><p>I hope you found this article useful. As a TL;DR let me leave you with a few useful references:</p><ul><li><a href="https://ubuntu.com/containers/chiselled/dotnet">https://ubuntu.com/containers/chiselled/dotnet</a></li><li><a href="https://github.com/canonical/chisel">https://github.com/canonical/chisel</a></li><li><a href="https://github.com/canonical/chisel-releases">https://github.com/canonical/chisel-releases</a></li><li><a href="https://medium.com/better-programming/the-whole-shebang-dockerfiles-5d59ace94d28?source=your_stories_page-------------------------------------">The Whole Shebang: Dockerfiles</a></li><li><a href="https://medium.com/gitconnected/the-whole-docker-shebang-part-1-docker-build-470f0c265702?source=your_stories_page-------------------------------------">The Whole Docker Shebang (part 1): docker build</a></li></ul><pre>Want to Connect?<br>Follow me on Medium - https://medium.com/@cristovaocordeiro</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d9bec38d124" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/teeny-weeny-containers-with-chisel-8d9bec38d124">Teeny-weeny containers, with Chisel</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Whole Shebang: Compose Files]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/the-whole-shebang-compose-files-5b6f50dd196c?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*mH0yw7Pu6NdGGTlX" width="4834"></a></p><p class="medium-feed-snippet">Master multi-container applications by understanding and practicing each and every option available for Docker Compose</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/the-whole-shebang-compose-files-5b6f50dd196c?source=rss-55e98c0205d6------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/the-whole-shebang-compose-files-5b6f50dd196c?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b6f50dd196c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Wed, 02 Feb 2022 17:49:06 GMT</pubDate>
            <atom:updated>2022-02-02T17:49:06.155Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Built My Own Lightboard for $100]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-humans/i-built-my-own-lightboard-for-100-9d7dd0b5205d?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*9EwgccZoSf16lzij" width="6880"></a></p><p class="medium-feed-snippet">And with this transparent chalkboard, my video courses suddenly became much more appealing</p><p class="medium-feed-link"><a href="https://medium.com/better-humans/i-built-my-own-lightboard-for-100-9d7dd0b5205d?source=rss-55e98c0205d6------2">Continue reading on Better Humans »</a></p></div>]]></description>
            <link>https://medium.com/better-humans/i-built-my-own-lightboard-for-100-9d7dd0b5205d?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d7dd0b5205d</guid>
            <category><![CDATA[light-board]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[online-courses]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Fri, 07 Jan 2022 09:33:34 GMT</pubDate>
            <atom:updated>2022-01-07T09:33:34.160Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Whole Shebang: Dockerfiles]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/the-whole-shebang-dockerfiles-5d59ace94d28?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*jP65gx9EYT2L3Tjl" width="2827"></a></p><p class="medium-feed-snippet">Learn by doing, with this practical tutorial with all the Dockerfile instructions explained through&#xA0;examples</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/the-whole-shebang-dockerfiles-5d59ace94d28?source=rss-55e98c0205d6------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/the-whole-shebang-dockerfiles-5d59ace94d28?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d59ace94d28</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Fri, 24 Dec 2021 14:22:36 GMT</pubDate>
            <atom:updated>2021-12-24T14:22:36.528Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Whole Docker Shebang (part 1): docker build]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/the-whole-docker-shebang-part-1-docker-build-470f0c265702?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2592/0*XT_oBfV7bgT8cT56" width="2592"></a></p><p class="medium-feed-snippet">Learn what every single option of the Docker build does, and how to use it, with examples</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/the-whole-docker-shebang-part-1-docker-build-470f0c265702?source=rss-55e98c0205d6------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/the-whole-docker-shebang-part-1-docker-build-470f0c265702?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/470f0c265702</guid>
            <category><![CDATA[docker-tutorial]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[docker-build]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Wed, 18 Aug 2021 00:01:44 GMT</pubDate>
            <atom:updated>2021-08-18T00:01:44.177Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[20 Things You Didn’t Know About CERN]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/illumination/20-things-you-didnt-know-about-cern-20ebde26fa7b?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2048/1*vahdkf7r_nWDK3BMF01L5Q.jpeg" width="2048"></a></p><p class="medium-feed-snippet">Wow your friends with some super interesting facts about CERN, like if you had actually been there</p><p class="medium-feed-link"><a href="https://medium.com/illumination/20-things-you-didnt-know-about-cern-20ebde26fa7b?source=rss-55e98c0205d6------2">Continue reading on ILLUMINATION »</a></p></div>]]></description>
            <link>https://medium.com/illumination/20-things-you-didnt-know-about-cern-20ebde26fa7b?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/20ebde26fa7b</guid>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[facts]]></category>
            <category><![CDATA[fun-facts]]></category>
            <category><![CDATA[cern]]></category>
            <category><![CDATA[beyourself]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Tue, 19 Jan 2021 23:00:47 GMT</pubDate>
            <atom:updated>2021-01-24T12:22:53.413Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Catalog of Awesome Trivia Sources for Polymaths]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/illumination/a-catalog-of-awesome-trivia-sources-for-polymaths-647d726651f3?source=rss-55e98c0205d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*f2xv6MT30pkL1XSC" width="4000"></a></p><p class="medium-feed-snippet">A curated list of entertaining sources for all sorts of trivia and fun facts. From podcasts, to Netflix shows and YouTube channels</p><p class="medium-feed-link"><a href="https://medium.com/illumination/a-catalog-of-awesome-trivia-sources-for-polymaths-647d726651f3?source=rss-55e98c0205d6------2">Continue reading on ILLUMINATION »</a></p></div>]]></description>
            <link>https://medium.com/illumination/a-catalog-of-awesome-trivia-sources-for-polymaths-647d726651f3?source=rss-55e98c0205d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/647d726651f3</guid>
            <category><![CDATA[facts]]></category>
            <category><![CDATA[podcast]]></category>
            <category><![CDATA[beyourself]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[youtube]]></category>
            <dc:creator><![CDATA[Cristovao Cordeiro]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 05:29:20 GMT</pubDate>
            <atom:updated>2021-01-14T05:29:20.711Z</atom:updated>
        </item>
    </channel>
</rss>