<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Features on Yamlfile</title><link>https://builderhub.github.io/Yamlfile/docs/features/</link><description>Recent content in Features on Yamlfile</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://builderhub.github.io/Yamlfile/docs/features/index.xml" rel="self" type="application/rss+xml"/><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>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></channel></rss>