<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Yamlfile</title><link>https://builderhub.github.io/Yamlfile/</link><description>Recent content on Yamlfile</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://builderhub.github.io/Yamlfile/index.xml" rel="self" type="application/rss+xml"/><item><title>Getting Started</title><link>https://builderhub.github.io/Yamlfile/docs/getting-started/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/getting-started/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;a class="anchor" href="#prerequisites"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Docker with BuildKit enabled (Docker 23+ or &lt;code&gt;DOCKER_BUILDKIT=1&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="using-a-released-image"&gt;Using a Released Image&lt;a class="anchor" href="#using-a-released-image"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The official images are published to &lt;code&gt;ghcr.io/builderhub/yamlfile&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In your &lt;code&gt;Yamlfile&lt;/code&gt; (or any file you pass with &lt;code&gt;-f&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# syntax=ghcr.io/builderhub/yamlfile:latest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;v1alpha1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;targets&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;myapp&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;golang:1.25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;steps&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;run&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;command&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;go build -o /out/myapp .&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then build with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker buildx build -f MyYamlfile &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --output type&lt;span style="color:#f92672"&gt;=&lt;/span&gt;image,name&lt;span style="color:#f92672"&gt;=&lt;/span&gt;myapp,push&lt;span style="color:#f92672"&gt;=&lt;/span&gt;false &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If your Yamlfile defines multiple top-level targets and you don&amp;rsquo;t want the default (first reachable), pass &lt;code&gt;--target&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>run.script — Baked-in Script Execution</title><link>https://builderhub.github.io/Yamlfile/docs/features/scripts/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/features/scripts/</guid><description>&lt;p&gt;One of Yamlfile&amp;rsquo;s most useful &amp;ldquo;baked-in&amp;rdquo; features is &lt;code&gt;run.script&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;steps&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;run&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;script&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;./scripts/install-deps.sh&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;env&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;DEBIAN_FRONTEND&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;noninteractive&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="how-it-works-without-you-writing-a-copy"&gt;How it works (without you writing a COPY)&lt;a class="anchor" href="#how-it-works-without-you-writing-a-copy"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;You list the script path in your Yamlfile.&lt;/li&gt;
&lt;li&gt;Yamlfile reads the file content from your build context (only the script you declared).&lt;/li&gt;
&lt;li&gt;A temporary scratch layer is created with the script content and executable permissions.&lt;/li&gt;
&lt;li&gt;The script is mounted &lt;strong&gt;read-only&lt;/strong&gt; into the &lt;code&gt;RUN&lt;/code&gt; filesystem at a generated path (e.g. &lt;code&gt;/.yamlfile-script-...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The script is executed directly (or via &lt;code&gt;/bin/sh&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Result: the script runs exactly as if it had been copied in, &lt;strong&gt;but it never appears in any layer of the final image&lt;/strong&gt; unless you later explicitly &lt;code&gt;copy&lt;/code&gt; it from the build stage.&lt;/p&gt;</description></item><item><title>Secrets (file and env forms)</title><link>https://builderhub.github.io/Yamlfile/docs/features/secrets/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/features/secrets/</guid><description>&lt;p&gt;Yamlfile supports BuildKit&amp;rsquo;s native secret mounts in a declarative way.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- &lt;span style="color:#f92672"&gt;run&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;script&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;./scripts/push-to-registry.sh&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;secrets&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;registry_token&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;env&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;REGISTRY_TOKEN &lt;/span&gt; &lt;span style="color:#75715e"&gt;# injected only for this run&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;id&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;netrc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;target&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;/root/.netrc &lt;/span&gt; &lt;span style="color:#75715e"&gt;# file form&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;mode&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;0600&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;optional&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="file-form-vs-env-form"&gt;File form vs. Env form&lt;a class="anchor" href="#file-form-vs-env-form"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;target:&lt;/code&gt; (or omitting it) → secret appears as a file (default location &lt;code&gt;/run/secrets/&amp;lt;id&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;env:&lt;/code&gt; → secret is exported as an environment variable inside the &lt;code&gt;RUN&lt;/code&gt; (the value is masked in logs by BuildKit).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both map directly to BuildKit&amp;rsquo;s &lt;code&gt;--mount=type=secret&lt;/code&gt; mechanism (file mount or &lt;code&gt;env=&lt;/code&gt; form).&lt;/p&gt;</description></item><item><title>Syntax Reference</title><link>https://builderhub.github.io/Yamlfile/docs/syntax-reference/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/syntax-reference/</guid><description>&lt;p&gt;This page is the authoritative reference for the structure understood by the &lt;code&gt;Yamlfile&lt;/code&gt; BuildKit frontend.&lt;/p&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Status&lt;/strong&gt;: The format is designed to be forward-compatible (unknown fields are retained via extensions). Most of the documented features work when you build with Yamlfile:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; &lt;code&gt;defaults.platform&lt;/code&gt; and per-target &lt;code&gt;platform:&lt;/code&gt; are honored (target.platform &amp;gt; defaults.platform &amp;gt; client &lt;code&gt;--platform&lt;/code&gt; / dockerui). See the Platform section below.&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; &lt;code&gt;builds:&lt;/code&gt; + &lt;code&gt;component:target&lt;/code&gt; cross-file refs — you can write the syntax, and it will give you a clear error if you try to use it. Actually loading and using targets from other Yamlfiles is not yet supported.&lt;/li&gt;
&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; Dependency graphs (including cycle detection) are fully supported. Independent targets are not artificially serialized. See &lt;a href="https://builderhub.github.io/Yamlfile/docs/features/parallelism/"&gt;Parallelism &amp;amp; Graphs&lt;/a&gt; for details.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See &lt;a href="https://builderhub.github.io/Yamlfile/docs/development/"&gt;Development&lt;/a&gt; for scope. Multi-file runtime remains the main pending item.&lt;/p&gt;</description></item><item><title>Multi-file Builds &amp; Cross-Target Copy</title><link>https://builderhub.github.io/Yamlfile/docs/features/multi-file/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/features/multi-file/</guid><description>&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You can write &lt;code&gt;builds:&lt;/code&gt; sections and use &lt;code&gt;component:target&lt;/code&gt; references (e.g. &lt;code&gt;from: &amp;quot;torch:base&amp;quot;&lt;/code&gt;) in your Yamlfile today. These will be accepted, but cross-file builds are not yet supported at runtime. Only targets defined in the &lt;em&gt;same&lt;/em&gt; Yamlfile can be used with &lt;code&gt;from:&lt;/code&gt; and &lt;code&gt;copy.from:&lt;/code&gt;. The examples below show the intended future behavior.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Multi-file orchestration will let a single top-level &lt;code&gt;Yamlfile&lt;/code&gt; coordinate builds defined in other &lt;code&gt;Yamlfile&lt;/code&gt;s (often in subdirectories) and then &lt;code&gt;copy&lt;/code&gt; artifacts across them.&lt;/p&gt;</description></item><item><title>Parallelism &amp; Dependency Graphs</title><link>https://builderhub.github.io/Yamlfile/docs/features/parallelism/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/features/parallelism/</guid><description>&lt;p&gt;When you define multiple top-level &lt;code&gt;targets&lt;/code&gt; that have no dependency on each other (no &lt;code&gt;from:&lt;/code&gt; or &lt;code&gt;copy.from:&lt;/code&gt; relationship), Yamlfile prepares them without forcing unnecessary ordering.&lt;/p&gt;
&lt;h3 id="what-this-means-for-your-builds"&gt;What this means for your builds&lt;a class="anchor" href="#what-this-means-for-your-builds"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Targets that don&amp;rsquo;t depend on one another won&amp;rsquo;t block each other.&lt;/li&gt;
&lt;li&gt;You don&amp;rsquo;t have to do anything special. Just write your targets with clear dependencies using &lt;code&gt;from:&lt;/code&gt; and &lt;code&gt;copy.from:&lt;/code&gt;. Yamlfile figures out what can safely run in parallel.&lt;/li&gt;
&lt;li&gt;BuildKit&amp;rsquo;s execution engine also runs independent operations concurrently and takes advantage of caching.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you request a specific target (with &lt;code&gt;--target&lt;/code&gt;), only the targets it actually needs will be built. Independent &amp;ldquo;sibling&amp;rdquo; targets that aren&amp;rsquo;t required are left alone.&lt;/p&gt;</description></item><item><title>Examples</title><link>https://builderhub.github.io/Yamlfile/docs/examples/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/examples/</guid><description>&lt;h2 id="minimal"&gt;Minimal&lt;a class="anchor" href="#minimal"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;See &lt;code&gt;examples/minimal.Yamlfile&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;v1alpha1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;targets&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;hello&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;alpine:3.19&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;steps&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;run&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;command&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;echo &amp;#34;hello from Yamlfile&amp;#34; &amp;gt; /msg.txt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;run&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;inline&lt;/span&gt;: |&lt;span style="color:#e6db74"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; echo &amp;#34;inline shell logic works&amp;#34; &amp;gt;&amp;gt; /msg.txt&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Build it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;docker buildx build -f examples/minimal.Yamlfile &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --build-arg BUILDKIT_SYNTAX&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ghcr.io/builderhub/yamlfile:latest &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --output type&lt;span style="color:#f92672"&gt;=&lt;/span&gt;local,dest&lt;span style="color:#f92672"&gt;=&lt;/span&gt;/tmp/out &lt;span style="color:#ae81ff"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; .
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat /tmp/out/msg.txt&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="multi-target--script--secret-typical-pattern"&gt;Multi-target + script + secret (typical pattern)&lt;a class="anchor" href="#multi-target--script--secret-typical-pattern"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A realistic pattern with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Independent targets (&lt;code&gt;prep&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;) that have no dep on each other.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;build&lt;/code&gt; target that uses &lt;code&gt;run.script&lt;/code&gt;, &lt;code&gt;run.env&lt;/code&gt;, and an &lt;code&gt;env:&lt;/code&gt; step.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;final&lt;/code&gt; target that copies outputs from multiple previous targets.&lt;/li&gt;
&lt;li&gt;A secret declared for the build step (supply at &lt;code&gt;docker buildx&lt;/code&gt; time with &lt;code&gt;--secret&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the complete, self-contained file + supporting script:&lt;/p&gt;</description></item><item><title>Why Yamlfile instead of a plain Dockerfile?</title><link>https://builderhub.github.io/Yamlfile/docs/vs-dockerfile/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/vs-dockerfile/</guid><description>&lt;p&gt;Traditional multi-stage Dockerfiles are extremely powerful but become difficult to reason about at scale:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Linear file order + implicit dependencies via &lt;code&gt;FROM foo&lt;/code&gt; / &lt;code&gt;COPY --from=foo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Lots of boilerplate for &amp;ldquo;download in parallel for cache&amp;rdquo; patterns (see the giant &lt;code&gt;torch/Dockerfile&lt;/code&gt; and &lt;code&gt;torch-extras/Dockerfile&lt;/code&gt; in coreweave/ml-containers).&lt;/li&gt;
&lt;li&gt;Scripts must be &lt;code&gt;COPY&lt;/code&gt;ed (or put in heredocs) even when you only want them for the build.&lt;/li&gt;
&lt;li&gt;Secret mounts are verbose and easy to get slightly wrong (leaking into layers or logs).&lt;/li&gt;
&lt;li&gt;Hard to express &amp;ldquo;these N independent things can be built in parallel and then combined&amp;rdquo;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Yamlfile makes the &lt;strong&gt;graph explicit&lt;/strong&gt;:&lt;/p&gt;</description></item><item><title>Development</title><link>https://builderhub.github.io/Yamlfile/docs/development/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://builderhub.github.io/Yamlfile/docs/development/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;a class="anchor" href="#prerequisites"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Docker with BuildKit (23+ recommended).&lt;/li&gt;
&lt;li&gt;Nix (for the hermetic dev shell that includes Go, hugo, linters, docker-buildx, etc.).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="setup"&gt;Setup&lt;a class="anchor" href="#setup"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git clone --recurse-submodules https://github.com/BuilderHub/Yamlfile.git
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd Yamlfile
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nix develop&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you already cloned without submodules: &lt;code&gt;git submodule update --init --recursive&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="common-commands"&gt;Common commands&lt;a class="anchor" href="#common-commands"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make help &lt;span style="color:#75715e"&gt;# list targets&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make ci &lt;span style="color:#75715e"&gt;# tests + lint + vet + revive&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make test
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make generate-schema &lt;span style="color:#75715e"&gt;# (re)generate docs/static/schema/v1alpha1.json from pkg/spec/v1alpha1 (also run by docs)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make docs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make docker-build &lt;span style="color:#75715e"&gt;# current-arch image tagged localhost... or REGISTRY=... TAG=...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See &lt;code&gt;Makefile&lt;/code&gt; for the full set (including multi-arch push flows used in release).&lt;/p&gt;</description></item></channel></rss>