<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Building and modifying Chainguard Containers on</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/</link><description>Recent content in Building and modifying Chainguard Containers on</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><copyright>Copyright (c) 2023 Chainguard</copyright><lastBuildDate>Fri, 04 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://edu.chainguard.dev/chainguard/containers/building-and-modifying/index.xml" rel="self" type="application/rss+xml"/><item><title>Installing APK packages in distroless variants</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/install-apks-in-distroless-variants/</link><pubDate>Tue, 21 Apr 2026 00:00:01 +0000</pubDate><guid>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/install-apks-in-distroless-variants/</guid><description>&lt;p&gt;This page documents workflows for installing APK packages in &lt;a href="https://edu.chainguard.dev/chainguard/containers/concepts/getting-started-distroless/"&gt;distroless variants&lt;/a&gt; of Chainguard container images, such as most builds tagged &lt;code&gt;:latest&lt;/code&gt;. We copy a filesystem from a distroless container image to a build image, install APKs to it using &lt;code&gt;chroot&lt;/code&gt;, then copy the modified filesystem back to the distroless image in the final step.&lt;/p&gt;
&lt;h2 id="overview-installing-packages-in-distroless-containers" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Overview: Installing packages in distroless containers&lt;/span&gt;
&lt;a href="#overview-installing-packages-in-distroless-containers" class="anchor" aria-label="Link to Overview: Installing packages in distroless containers" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The distroless variants of Chainguard Containers do not contain shells or package managers by design. This reduces attack surface and exploitability for these images. In cases where additional packages are required, we typically recommend the following:&lt;/p&gt;</description></item><item><title>Using the Chainguard static base container image</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/static-base-image/</link><pubDate>Wed, 30 Aug 2023 15:21:01 +0000</pubDate><guid>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/static-base-image/</guid><description>&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/ZT6177U0fUM?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;h2 id="tools-used-in-this-video" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Tools used in this video&lt;/span&gt;
&lt;a href="#tools-used-in-this-video" class="anchor" aria-label="Link to Tools used in this video" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docker.com"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/anchore/grype"&gt;Grype&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="dockerfile" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Dockerfile&lt;/span&gt;
&lt;a href="#dockerfile" class="anchor" aria-label="Link to Dockerfile" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;pre class="highlight" data-language="Dockerfile"&gt;&lt;code class="language-Dockerfile" data-lang="Dockerfile"&gt;FROM cgr.dev/chainguard/go AS build
COPY main.go /main.go
RUN CGO_ENABLED=0 go build -o /hello /main.go
FROM cgr.dev/chainguard/static
COPY --from=build /hello /usr/local/bin/
CMD [&amp;#34;hello&amp;#34;]&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="transcript" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Transcript&lt;/span&gt;
&lt;a href="#transcript" class="anchor" aria-label="Link to Transcript" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;So what&amp;rsquo;s the best container base image to use?&lt;/p&gt;</description></item><item><title>Building minimal container images for applications with runtimes</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/minimal-runtime-images/</link><pubDate>Wed, 06 Sep 2023 01:21:01 +0000</pubDate><guid>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/minimal-runtime-images/</guid><description>&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/P7pmV-s5ZYY?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;h2 id="tools-used-in-this-video" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Tools used in this video&lt;/span&gt;
&lt;a href="#tools-used-in-this-video" class="anchor" aria-label="Link to Tools used in this video" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docker.com"&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="resources" class="heading-2" data-heading-level="2"&gt;
&lt;span class="heading-text"&gt;Resources&lt;/span&gt;
&lt;a href="#resources" class="anchor" aria-label="Link to Resources" title="Link to this section"&gt;
&lt;svg width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"&gt;
&lt;path d="M6.833 8.125H4C3 8.125 2.146 7.77067 1.438 7.062C0.729333 6.354 0.375 5.5 0.375 4.5C0.375 3.5 0.729333 2.646 1.438 1.938C2.146 1.22933 3 0.875 4 0.875H6.833V1.958H4C3.30533 1.958 2.708 2.208 2.208 2.708C1.708 3.208 1.458 3.80533 1.458 4.5C1.458 5.19467 1.708 5.792 2.208 6.292C2.708 6.792 3.30533 7.042 4 7.042H6.833V8.125ZM5.208 5.042V3.958H10.792V5.042H5.208ZM9.167 8.125V7.042H12C12.6947 7.042 13.292 6.792 13.792 6.292C14.292 5.792 14.542 5.19467 14.542 4.5C14.542 3.80533 14.292 3.208 13.792 2.708C13.292 2.208 12.6947 1.958 12 1.958H9.167V0.875H12C13 0.875 13.854 1.22933 14.562 1.938C15.2707 2.646 15.625 3.5 15.625 4.5C15.625 5.5 15.2707 6.354 14.562 7.062C13.854 7.77067 13 8.125 12 8.125H9.167Z" fill="currentColor"/&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The Dockerfiles used in this video and other supporting documentation are &lt;a href="https://github.com/chainguard-dev/minimal_images_for_language_runtimes"&gt;available on GitHub&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Chainguard packages</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/packages/</link><pubDate>Fri, 12 Sep 2025 08:48:45 +0000</pubDate><guid>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/packages/</guid><description/></item><item><title>Build tools</title><link>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/build-tools/</link><pubDate>Fri, 04 Sep 2026 00:00:00 +0000</pubDate><guid>https://edu.chainguard.dev/chainguard/containers/building-and-modifying/build-tools/</guid><description/></item></channel></rss>