Skip to content

Commit

Permalink
Merge pull request #622 from WYGIN/build-config-env
Browse files Browse the repository at this point in the history
Docs for new [[build.env]] table in builder.toml
  • Loading branch information
AidanDelaney committed Nov 3, 2023
1 parent eb61d4c commit 6a34f8c
Show file tree
Hide file tree
Showing 31 changed files with 84 additions and 606 deletions.
3 changes: 2 additions & 1 deletion categories/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link>https://buildpacks.io/categories/</link>
<description>Recent content in Categories on Cloud Native Buildpacks</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language><atom:link href="https://buildpacks.io/categories/index.xml" rel="self" type="application/rss+xml" />
<language>en-us</language>
<atom:link href="https://buildpacks.io/categories/index.xml" rel="self" type="application/rss+xml" />
</channel>
</rss>
27 changes: 2 additions & 25 deletions docs/app-developer-guide/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,114 +5,91 @@
<link>https://buildpacks.io/docs/app-developer-guide/</link>
<description>Recent content in App Developer Guide on Cloud Native Buildpacks</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language><atom:link href="https://buildpacks.io/docs/app-developer-guide/index.xml" rel="self" type="application/rss+xml" />
<language>en-us</language>
<atom:link href="https://buildpacks.io/docs/app-developer-guide/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Build an app</title>
<link>https://buildpacks.io/docs/app-developer-guide/build-an-app/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/build-an-app/</guid>
<description>The basics of taking your app from source code to runnable image.</description>
</item>

<item>
<title>Build a Windows app</title>
<link>https://buildpacks.io/docs/app-developer-guide/build-a-windows-app/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/build-a-windows-app/</guid>
<description>The basics of taking your Windows app from source code to runnable image.</description>
</item>

<item>
<title>Build an ARM app</title>
<link>https://buildpacks.io/docs/app-developer-guide/build-an-arm-app/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/build-an-arm-app/</guid>
<description>The basics of taking your app from source code to runnable ARM image.</description>
</item>

<item>
<title>Environment variables</title>
<link>https://buildpacks.io/docs/app-developer-guide/environment-variables/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/environment-variables/</guid>
<description>Environment variables are a common way to configure various buildpacks at build-time.</description>
</item>

<item>
<title>Cache Images</title>
<link>https://buildpacks.io/docs/app-developer-guide/using-cache-image/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/using-cache-image/</guid>
<description>Learn how to use cache-images to share cached layers</description>
</item>

<item>
<title>Mounting Volumes</title>
<link>https://buildpacks.io/docs/app-developer-guide/mounting-volumes/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/mounting-volumes/</guid>
<description>Volumes are a mechanism for both supplying and persisting data generated by build containers.</description>
</item>

<item>
<title>Specify buildpacks</title>
<link>https://buildpacks.io/docs/app-developer-guide/specify-buildpacks/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/specify-buildpacks/</guid>
<description>Learn how to specify exactly what buildpacks are used during the build process.</description>
</item>

<item>
<title>Specify launch process</title>
<link>https://buildpacks.io/docs/app-developer-guide/run-an-app/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/run-an-app/</guid>
<description>Learn how to specify the launch process for an app.</description>
</item>

<item>
<title>Using project.toml</title>
<link>https://buildpacks.io/docs/app-developer-guide/using-project-descriptor/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/using-project-descriptor/</guid>
<description>Learn how to use a project.toml file to simplify configuring pack.</description>
</item>

<item>
<title>Using Inline Buildpacks</title>
<link>https://buildpacks.io/docs/app-developer-guide/using-inline-buildpacks/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/using-inline-buildpacks/</guid>
<description>Learn how to create an ephemeral buildpack to customize your build.</description>
</item>

<item>
<title>Using Buildpacks with a Proxy</title>
<link>https://buildpacks.io/docs/app-developer-guide/using-http-proxy/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/using-http-proxy/</guid>
<description>Learn how to use buildpacks behind a HTTP proxy.</description>
</item>

<item>
<title>Building on Podman</title>
<link>https://buildpacks.io/docs/app-developer-guide/building-on-podman/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/app-developer-guide/building-on-podman/</guid>
<description>Use podman as an alternative to Docker with Cloud Native Buildpacks.</description>
</item>

</channel>
</rss>
21 changes: 2 additions & 19 deletions docs/buildpack-author-guide/create-buildpack/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/</link>
<description>Recent content in Create a buildpack on Cloud Native Buildpacks</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language><atom:link href="https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/index.xml" rel="self" type="application/rss+xml" />
<language>en-us</language>
<atom:link href="https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Set up your local environment</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/setup-local-environment/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/setup-local-environment/</guid>
<description>First, we&amp;rsquo;ll create a sample Ruby app that you can use when developing your buildpack:
mkdir ruby-sample-app Create a file in the current directory called ruby-sample-app/app.rb with the following contents:
require &amp;#39;sinatra&amp;#39; set :bind, &amp;#39;0.0.0.0&amp;#39; set :port, 8080 get &amp;#39;/&amp;#39; do &amp;#39;Hello World!&amp;#39; end Then, create a file called ruby-sample-app/Gemfile with the following contents:
source &amp;#39;http://rubygems.org&amp;#39; git_source(:github) {|repo_name| &amp;#34;https://github.com/#{repo_name}&amp;#34; } gem &amp;#39;sinatra&amp;#39; gem &amp;#39;webrick&amp;#39; Finally, make sure your local Docker daemon is running by executing:</description>
</item>

<item>
<title>Building blocks of a Cloud Native Buildpack</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/building-blocks-cnb/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/building-blocks-cnb/</guid>
<description>Now we will set up the buildpack scaffolding.
Let&amp;rsquo;s create the directory where your buildpack will live:
Expand All @@ -31,82 +29,67 @@ Example:
pack buildpack new examples/ruby \ --api 0.8 \ --path ruby-buildpack \ --version 0.0.1 \ --stacks io.buildpacks.samples.stacks.jammy This command will create ruby-buildpack directory which contains buildpack.toml, bin/build, bin/detect files.
Additional Parameters -a, --api Buildpack API compatibility of the generated buildpack -h, --help Help for &amp;rsquo;new&#39; --path the location on the filesystem to generate the artifacts --stacks Stacks (deprecated) the buildpack will work with -V, --version the version of the buildpack in buildpack.</description>
</item>

<item>
<title>Detecting your application</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/detection/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/detection/</guid>
<description>Next, you will want to actually detect that the app you are building is a Ruby app. In order to do this, you will need to check for a Gemfile.
Replace exit 1 in the detect script with the following check:
if [[ ! -f Gemfile ]]; then exit 100 fi Your ruby-buildpack/bin/detect script should look like this:
#!/usr/bin/env bash set -eo pipefail if [[ ! -f Gemfile ]]; then exit 100 fi Next, rebuild your app with the updated buildpack:</description>
</item>

<item>
<title>Building your application</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/build-app/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/build-app/</guid>
<description>Now we&amp;rsquo;ll change the build step you created to install application dependencies. This will require updates to the build script such that it performs the following steps:
Creates a layer for the Ruby runtime Downloads the Ruby runtime and installs it to the layer Installs Bundler (the Ruby dependency manager) Uses Bundler to install dependencies By doing this, you&amp;rsquo;ll learn how to create arbitrary layers with your buildpack, and how to read the contents of the app in order to perform actions like downloading dependencies.</description>
</item>

<item>
<title>Make your application runnable</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/make-app-runnable/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/make-app-runnable/</guid>
<description>To make your app runnable, a default start command must be set. You&amp;rsquo;ll need to add the following to the end of your build script:
# ... # Set default start command cat &amp;gt; &amp;#34;$layersdir/launch.toml&amp;#34; &amp;lt;&amp;lt; EOL [[processes]] type = &amp;#34;web&amp;#34; command = &amp;#34;bundle exec ruby app.rb&amp;#34; default = true EOL # ... Your full ruby-buildpack/bin/build script should now look like the following:
#!/usr/bin/env bash set -eo pipefail echo &amp;#34;---&amp;gt; Ruby Buildpack&amp;#34; # 1.</description>
</item>

<item>
<title>Specify multiple process types</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/specify-multiple-process-types/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/specify-multiple-process-types/</guid>
<description>One of the benefits of buildpacks is that they are multi-process - an image can have multiple entrypoints for each operational mode. Let&amp;rsquo;s see how this works. We will extend our app to have a worker process.
Let&amp;rsquo;s create a worker file, ruby-sample-app/worker.rb, with the following contents:
for i in 0..5 puts &amp;#34;Running a worker task...&amp;#34; end After building our app, we could run the resulting image with the web process (currently the default) or our new worker process.</description>
</item>

<item>
<title>Improving performance with caching</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/caching/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/caching/</guid>
<description>We can improve performance by caching dependencies between builds, only re-downloading when necessary. To begin, let&amp;rsquo;s create a cacheable bundler layer.
Creating the bundler layer To do this, replace the following lines in the build script:
echo &amp;#34;---&amp;gt; Installing gems&amp;#34; bundle install with the following:
echo &amp;#34;---&amp;gt; Installing gems&amp;#34; bundlerlayer=&amp;#34;$layersdir/bundler&amp;#34; mkdir -p &amp;#34;$bundlerlayer&amp;#34; echo -e &amp;#39;[types]\ncache = true\nlaunch = true&amp;#39; &amp;gt; &amp;#34;$layersdir/bundler.toml&amp;#34; bundle config set --local path &amp;#34;$bundlerlayer&amp;#34; &amp;amp;&amp;amp; bundle install &amp;amp;&amp;amp; bundle binstubs --all --path &amp;#34;$bundlerlayer/bin&amp;#34; Your full ruby-buildpack/bin/build script should now look like the following:</description>
</item>

<item>
<title>Making your buildpack configurable</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/make-buildpack-configurable/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/make-buildpack-configurable/</guid>
<description>It&amp;rsquo;s likely that not all Ruby apps will want to use the same version of Ruby. Let&amp;rsquo;s make the Ruby version configurable.
Select Ruby version We&amp;rsquo;ll allow buildpack users to define the desired Ruby version via a .ruby-version file in their app. We&amp;rsquo;ll first update the detect script to check for this file. We will then record the dependency we can provide (Ruby), as well as the specific dependency the application will require, in the Build Plan, a document the lifecycle uses to determine if the buildpack will provide everything the application needs.</description>
</item>

<item>
<title>Adding Bill-of-Materials</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/adding-bill-of-materials/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/create-buildpack/adding-bill-of-materials/</guid>
<description>One of the benefits of buildpacks is they can also populate the app image with metadata from the build process, allowing you to audit the app image for information like:
The process types that are available and the commands associated with them The run-image the app image was based on The buildpacks were used to create the app image Whether the run-image can be rebased with a new version through the Rebasable label or not And more&amp;hellip;!</description>
</item>

</channel>
</rss>
13 changes: 2 additions & 11 deletions docs/buildpack-author-guide/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,42 @@
<link>https://buildpacks.io/docs/buildpack-author-guide/</link>
<description>Recent content in Buildpack Author Guide on Cloud Native Buildpacks</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language><atom:link href="https://buildpacks.io/docs/buildpack-author-guide/index.xml" rel="self" type="application/rss+xml" />
<language>en-us</language>
<atom:link href="https://buildpacks.io/docs/buildpack-author-guide/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Package a buildpack</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/package-a-buildpack/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/package-a-buildpack/</guid>
<description>Learn how to package your buildpack for distribution using standard OCI registries.</description>
</item>

<item>
<title>Publish a buildpack</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/publish-a-buildpack/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/publish-a-buildpack/</guid>
<description>Learn how to publish your buildpack to the Buildpack Registry.</description>
</item>

<item>
<title>Publishing with Github Actions</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/publishing-with-github-actions/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/publishing-with-github-actions/</guid>
<description>Learn how to automatically publish your buildpack to the Buildpack Registry from a Github Action.</description>
</item>

<item>
<title>Layer Types</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/caching-strategies/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/caching-strategies/</guid>
<description>Learn strategies for caching layers.</description>
</item>

<item>
<title>Overview of Buildpacks Phases</title>
<link>https://buildpacks.io/docs/buildpack-author-guide/build-phases-overview/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

<guid>https://buildpacks.io/docs/buildpack-author-guide/build-phases-overview/</guid>
<description>We work through a full example of building a &amp;ldquo;hello world&amp;rdquo; NodeJs web application. In the example we run pack on the NodeJS application to produce an application image. We assume that we have a NodeJS buildpack, registry.fake/buildpacks/nodejs:latest, that is decomposed into buildpacks that help with the build. We expand each of the buildpacks phases to explain the process. Throughout the example we take a production-level view of their operation. For example, our assumed NodeJS buildpack will be described to create different build, cache and launch layers in a manner similar to how a real NodeJS buildpack would operate.</description>
</item>

</channel>
</rss>
Loading

0 comments on commit 6a34f8c

Please sign in to comment.