diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6506c2b22..ae7764b96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - name: Install Dependencies run: sudo apt-get install make curl jq - name: Install pack - uses: buildpacks/github-actions/setup-pack@v5.7.4 + uses: buildpacks/github-actions/setup-pack@v5.8.2 with: pack-version: '0.31.0' - name: Test diff --git a/content/docs/app-journey.md b/content/docs/app-journey.md index 62f486145..90c220ee3 100644 --- a/content/docs/app-journey.md +++ b/content/docs/app-journey.md @@ -63,7 +63,7 @@ cd samples/apps/java-maven 3. Build the app using [`pack`][pack-docs] ``` -pack build myapp --builder cnbs/sample-builder:jammy +pack build myapp --builder cnbs/sample-builder:noble ``` diff --git a/content/docs/for-app-developers/concepts/build.md b/content/docs/for-app-developers/concepts/build.md index 5cafcdf9e..f43baea68 100644 --- a/content/docs/for-app-developers/concepts/build.md +++ b/content/docs/for-app-developers/concepts/build.md @@ -23,5 +23,4 @@ Builders provide a convenient way to distribute buildpacks. [build-time base image]: /docs/for-app-developers/concepts/base-images/build/ [builder]: /docs/for-platform-operators/concepts/builder [buildpack]: /docs/for-app-developers/concepts/buildpack/ -[lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ [runtime base image]: /docs/for-app-developers/concepts/base-images/run/ diff --git a/content/docs/for-app-developers/concepts/builder.md b/content/docs/for-app-developers/concepts/builder.md index b583e06f1..557311492 100644 --- a/content/docs/for-app-developers/concepts/builder.md +++ b/content/docs/for-app-developers/concepts/builder.md @@ -10,7 +10,7 @@ a [build-time base image], a [lifecycle] binary, and a reference to a [runtime b The [build-time base image] provides the base environment for the `builder` -(e.g., an Ubuntu Jammy OS image with build tooling) and +(e.g., an Ubuntu Noble OS image with build tooling) and a [runtime base image] provides the base environment for the `app image` during runtime. ![builder](/images/builder.svg) diff --git a/content/docs/for-app-developers/concepts/experimental-features.md b/content/docs/for-app-developers/concepts/experimental-features.md new file mode 100644 index 000000000..a989a05e5 --- /dev/null +++ b/content/docs/for-app-developers/concepts/experimental-features.md @@ -0,0 +1,36 @@ ++++ +title="What are experimental features?" +weight=8 ++++ + +Certain features are considered `experimental` and susceptible to change in future API versions. + + + +This means users will need to enable the `experimental` mode in order to use one of these features. + +If using `pack`, run `pack config experimental true`, or add `experimental = true` to your `~/.pack/config.toml` file to enable experimental features. + +If using the `lifecycle` directly, set the `CNB_EXPERIMENTAL_MODE` [environment variable](https://github.com/buildpacks/spec/blob/main/platform.md#experimental-features). + +The following features are experimental for `pack`: + +* building for [Windows containers][windows] +* exporting to [OCI layout][oci-layout] format on disk +* Interacting with the [buildpack registry][registry] +* `pack manifest` commands +* `pack buildpack --flatten` +* `pack build --interactive` +* When building, reading project metadata version & source URL from [project.toml][project-descriptor] + +The following features are experimental for `lifecycle`: + +* Building for [Windows containers][windows] +* Exporting to [OCI layout][oci-layout] format on disk + +For more information and to look at an example of how this might be valuable, see [Export to OCI layout format on disk][oci-layout]. + +[oci-layout]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/export-to-oci-layout/ +[project-descriptor]: https://buildpacks.io/docs/reference/config/project-descriptor/ +[registry]: https://buildpacks.io/docs/for-buildpack-authors/how-to/distribute-buildpacks/publish-buildpack/ +[windows]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/build-for-windows/ diff --git a/content/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment.md b/content/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment.md index 817725886..227ffe282 100644 --- a/content/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment.md +++ b/content/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment.md @@ -33,7 +33,7 @@ export FOO=BAR pack build sample-app \ --env "HELLO=WORLD" \ --env "FOO" \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/buildpacks/hello-world/ \ --buildpack samples/apps/bash-script/bash-script-buildpack/ \ --path samples/apps/bash-script/ @@ -79,7 +79,7 @@ echo -en "HELLO=WORLD\nFOO" > ./envfile ``` pack build sample-app \ --env-file ./envfile \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/buildpacks/hello-world/ \ --buildpack samples/apps/bash-script/bash-script-buildpack/ \ --path samples/apps/bash-script/ @@ -125,7 +125,7 @@ EOL 2. Build the app ``` pack build sample-app \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/buildpacks/hello-world/ \ --buildpack samples/apps/bash-script/bash-script-buildpack/ \ --path samples/apps/bash-script/ diff --git a/content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md b/content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md index e8a737933..955319548 100644 --- a/content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md +++ b/content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md @@ -4,6 +4,15 @@ weight=99 summary="Buildpacks can define multiple processes for an application image. Specify which process should be the default." +++ -This page is a stub! The CNB project is applying to [Google Season of Docs](https://developers.google.com/season-of-docs/docs/timeline) to receive support for improving our documentation. Please check back soon. +While buildpacks usually define the default process type for an application, end users may specify the desired default process. -If you are familiar with this content and would like to make a contribution, please feel free to open a PR :) +To specify the default process: + +* You first need to know what named process types might be contributed by the buildpacks in your build; for more information, see docs for [running the application][Run the application] +* Append the following flag to the `pack build` command: + +```bash +pack build --default-process ` # must be a valid process name +``` + +[Run the application]: https://buildpacks.io/docs/for-app-developers/how-to/build-outputs/specify-launch-process/ diff --git a/content/docs/for-app-developers/how-to/build-inputs/use-cache-image.md b/content/docs/for-app-developers/how-to/build-inputs/use-cache-image.md index b11c61779..a7a041b35 100644 --- a/content/docs/for-app-developers/how-to/build-inputs/use-cache-image.md +++ b/content/docs/for-app-developers/how-to/build-inputs/use-cache-image.md @@ -29,10 +29,10 @@ For the following examples we will use: > **NOTE:** If we wish to publish to an external registry like `Dockerhub` we will first need to authenticate with `docker` to allow us to push images. We can do this via `docker login` -Next we trust the `cnbs/sample-builder:jammy` builder in order to allow access to docker credentials when publishing. +Next we trust the `cnbs/sample-builder:noble` builder in order to allow access to docker credentials when publishing. ``` -pack config trusted-builders add cnbs/sample-builder:jammy +pack config trusted-builders add cnbs/sample-builder:noble ``` @@ -42,7 +42,7 @@ To build the `localhost:5000/buildpack-examples/cache-image-example` application ``` pack build localhost:5000/buildpack-examples/cache-image-example \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/java-maven \ --path samples/apps/java-maven \ --cache-image localhost:5000/buildpack-examples/maven-cache-image:latest \ @@ -76,7 +76,7 @@ builds may also update the specified `cache-image`. The following command will restore data for the `samples/java-maven:maven_m2` layer from the cache image. ``` pack build localhost:5000/buildpack-examples/second-cache-image-example \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/java-maven \ --path samples/apps/java-maven \ --cache-image localhost:5000/buildpack-examples/maven-cache-image:latest \ diff --git a/content/docs/for-app-developers/how-to/build-inputs/use-project-toml.md b/content/docs/for-app-developers/how-to/build-inputs/use-project-toml.md index 91920c924..c9505c425 100644 --- a/content/docs/for-app-developers/how-to/build-inputs/use-project-toml.md +++ b/content/docs/for-app-developers/how-to/build-inputs/use-project-toml.md @@ -45,7 +45,7 @@ To use a `project.toml` file, simply: ```shell script # build the app pack build sample-app \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --path samples/apps/bash-script/ # run the app @@ -55,7 +55,7 @@ docker run sample-app If the descriptor is named `project.toml`, it will be read by `pack` automatically. Otherwise, you can run: ```shell script pack build sample-app \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --path samples/apps/bash-script/ \ --descriptor samples/apps/bash-script/ ``` @@ -99,7 +99,7 @@ Paste the above `toml` as `new-project.toml` in the `samples/apps/bash-script/` ```shell script # build the app pack build sample-app \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --path samples/apps/bash-script/ \ --descriptor samples/apps/bash-script/new-project.toml @@ -112,7 +112,7 @@ The builder can also be [specified](https://github.com/buildpacks/spec/blob/main ```toml [io.buildpacks] -builder = "cnbs/sample-builder:jammy" +builder = "cnbs/sample-builder:noble" ``` ```shell script diff --git a/content/docs/for-app-developers/how-to/build-inputs/use-volume-mounts.md b/content/docs/for-app-developers/how-to/build-inputs/use-volume-mounts.md index e5dc705f7..7e55bbe4f 100644 --- a/content/docs/for-app-developers/how-to/build-inputs/use-volume-mounts.md +++ b/content/docs/for-app-developers/how-to/build-inputs/use-volume-mounts.md @@ -83,7 +83,7 @@ Now, we can mount this volume during `pack build`: ```bash ls -al pack build volume-example \ - --builder cnbs/sample-builder:jammy \ + --builder cnbs/sample-builder:noble \ --buildpack samples/buildpacks/hello-world \ --path samples/apps/bash-script \ --volume test-volume:/platform/volume:ro diff --git a/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md b/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md index 3d97b4288..b1967f764 100644 --- a/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md +++ b/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md @@ -8,20 +8,24 @@ Buildpacks-built images contain metadata that allow you to audit both the image Information includes: + * 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...! +`pack` offers a command to help you inspect the application image and view some of its contents as shown below: + ```bash pack inspect-image test-node-js-app ``` + You should see the following: ```text Run Images: - cnbs/sample-base-run:jammy + cnbs/sample-base-run:noble ... Buildpacks: @@ -35,4 +39,25 @@ Processes: Apart from the above standard metadata, buildpacks can also populate information about the dependencies they have provided in form of a `Software Bill-of-Materials` or [SBOM]. +Buildpacks-built images are constructed in a way that’s easy to understand, with each of the layers being meaningful and independent of all other layers. You can get more details about each layer and how it was created to better understand how the [build] actually worked. + +There are a number of available tools that can help you achieve this and understand what is contained in your `OCI` image; a popular one is [dive]. + +`Dive` can help you inspect `OCI` images and view their layers and each layer's details. If you were to build an `OCI` image following the [multi process app] example and run `dive` on the generated image, you'll be presented with some detailed information about all of the image layers and the contents of each layer. + +You can use `dive` as follows: + +```bash +dive multi-process-app +``` + +The output should look similar to the following: + +PLACEHOLDER + +As seen in the output above, you're presented with `Layers`, `Layer Details`, `Image Details`, and `Current Layer Contents`. To view the contents or explore the file tree of any layer, you need to select the layer on the left using the arrow keys. + [SBOM]: /docs/for-app-developers/how-to/build-outputs/download-sbom +[build]: https://buildpacks.io/docs/for-app-developers/concepts/build/ +[Dive]: https://github.com/wagoodman/dive +[multi process app]: https://buildpacks.io/docs/for-app-developers/how-to/build-outputs/specify-launch-process/#build-a-multi-process-app diff --git a/content/docs/for-app-developers/how-to/build-outputs/specify-launch-process.md b/content/docs/for-app-developers/how-to/build-outputs/specify-launch-process.md index 562cb0d2e..419f35f99 100644 --- a/content/docs/for-app-developers/how-to/build-outputs/specify-launch-process.md +++ b/content/docs/for-app-developers/how-to/build-outputs/specify-launch-process.md @@ -1,4 +1,3 @@ - +++ title="Run the application" aliases=[ @@ -15,7 +14,8 @@ Buildpacks-built images can contain multiple process types. For this example we will use the `hello-processes` buildpack from our [samples][samples] repo so make sure you have it cloned locally. Let's build the app. -``` + +```bash pack build multi-process-app \ --builder cnbs/sample-builder:alpine \ --buildpack samples/java-maven \ @@ -26,14 +26,14 @@ pack build multi-process-app \ If you inspect the app image with `pack`, you will see multiple process types defined: -``` +```bash pack inspect-image multi-process-app ``` The output should look similar to the below: -``` +```text Inspecting image: multi-process-app REMOTE: @@ -76,16 +76,18 @@ The `launcher` will source any profile scripts (for `non-direct` processes) and If you would like to run the default process, you can simply run the app image without any additional arguments: -``` +```bash docker run --rm -p 8080:8080 multi-process-app ``` +>As an app developer, you can specify what the default process is; see the [specify default launch process][default-process] page for more information. + #### Default process type with additional arguments If you would like to pass additional arguments to the default process, you can run the app image with the arguments specified in the command: -``` +```bash docker run --rm -p 8080:8080 multi-process-app --spring.profiles.active=mysql ``` @@ -94,7 +96,7 @@ docker run --rm -p 8080:8080 multi-process-app --spring.profiles.active=mysql To run a non-default process type, set the process type as the entrypoint for the run container: -``` +```bash docker run --rm --entrypoint sys-info multi-process-app ``` @@ -103,7 +105,7 @@ docker run --rm --entrypoint sys-info multi-process-app You can pass additional arguments to a non-default process type: -``` +```bash docker run --rm --entrypoint sys-info multi-process-app --spring.profiles.active=mysql ``` @@ -112,21 +114,24 @@ docker run --rm --entrypoint sys-info multi-process-app --spring.profiles.active You can even override the buildpack-defined process types: -``` +```bash docker run --rm --entrypoint launcher -it multi-process-app bash ``` -Now let's exit this shell and run an alternative entrypoint - -``` +Now let's exit this shell and run an alternative entrypoint - + +```bash exit ``` -``` + +```bash docker run --rm --entrypoint launcher -it multi-process-app echo hello "$WORLD" # $WORLD is evaluated on the host machine ``` -``` + +```bash docker run --rm --entrypoint launcher -it multi-process-app echo hello '$WORLD' # $WORLD is evaluated in the container after profile scripts are sourced ``` @@ -135,7 +140,7 @@ docker run --rm --entrypoint launcher -it multi-process-app echo hello '$WORLD' An entire script may be provided as a single argument: -``` +```bash docker run --rm --entrypoint launcher -it multi-process-app 'for opt in $JAVA_OPTS; do echo $opt; done' ``` @@ -145,7 +150,7 @@ docker run --rm --entrypoint launcher -it multi-process-app 'for opt in $JAVA_OP By passing `--` before the command, we instruct the `launcher` to start the provided process without `bash`. Note that while buildpack-provided environment variables will be set in the execution environment, no profile scripts will be sourced (as these require `bash`): -``` +```text docker run --rm --entrypoint launcher multi-process-app -- env # output will include buildpack-provided env vars docker run --rm --entrypoint launcher multi-process-app -- echo hello "$WORLD" # $WORLD is evaluated on the host machine docker run --rm --entrypoint launcher multi-process-app -- echo hello '$WORLD' # $WORLD is not evaluated, output will include string literal `$WORLD` @@ -155,7 +160,7 @@ docker run --rm --entrypoint launcher multi-process-app -- echo hello '$WORLD' # You can bypass the launcher entirely by setting a new entrypoint for the run container: -``` +```bash docker run --rm --entrypoint bash -it multi-process-app # profile scripts have NOT been sourced and buildpack-provided env vars are NOT set in this shell ``` @@ -163,3 +168,4 @@ docker run --rm --entrypoint bash -it multi-process-app # profile scripts have N To learn more about the launcher, see the [platform spec](https://github.com/buildpacks/spec/blob/main/platform.md#launcher). [samples]: https://github.com/buildpacks/samples +[default-process]: https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process/ diff --git a/content/docs/for-app-developers/how-to/build-outputs/understand-failures.md b/content/docs/for-app-developers/how-to/build-outputs/understand-failures.md index 4c35fe79b..3146be9c5 100644 --- a/content/docs/for-app-developers/how-to/build-outputs/understand-failures.md +++ b/content/docs/for-app-developers/how-to/build-outputs/understand-failures.md @@ -4,6 +4,35 @@ weight=99 summary="How to troubleshoot when things go wrong." +++ -This page is a stub! The CNB project is applying to [Google Season of Docs](https://developers.google.com/season-of-docs/docs/timeline) to receive support for improving our documentation. Please check back soon. +While `Buildpacks` help developers transform source code into container images that can run on any cloud, creating an error-free experience remains far from achieved. -If you are familiar with this content and would like to make a contribution, please feel free to open a PR :) +This guide catalogs some commonly reported issues that may prevent image build completion and provides troubleshooting tips to help end-users navigate these issues. + +If you would like to report an issue, please open a PR against this page using the included template (see bottom of page in Markdown). + +#### Issue: `ERROR: failed to build: failed to fetch base layers: saving image with ID "sha256:" from the docker daemon: Error response from daemon: unable to create manifests file: NotFound: content digest sha256:: not found` + +**Occurs when**: building and saving to a docker daemon +**Analysis**: this seems to indicate a problem with the underlying image store in `Docker` +**Remediation**: remove existing images with `docker image prune` (potentially, from multiple storage drivers if switching between `overlay2` and `containerd`) +**Related error messages**: + +* `ERROR: failed to initialize analyzer: getting previous image: get history for image "test": Error response from daemon: NotFound: snapshot sha256: does not exist: not found` +* `ERROR: failed to export: saving image: failed to fetch base layers: open /tmp/imgutil.local.image./blobs/sha256/: no such file or directory` + +**For more information**: + +* [Issue link on GitHub](https://github.com/buildpacks/pack/issues/2270) +* [Slack thread](https://cloud-native.slack.com/archives/C0331B61A1Y/p1717422902392339?thread_ts=1717185700.984459&cid=C0331B61A1Y) +* [Another Slack thread](https://cloud-native.slack.com/archives/C033DV8D9FB/p1730243369203799) + + \ No newline at end of file diff --git a/content/docs/for-app-developers/how-to/special-cases/build-on-podman.md b/content/docs/for-app-developers/how-to/special-cases/build-on-podman.md index 6f0d16c32..6650c7370 100644 --- a/content/docs/for-app-developers/how-to/special-cases/build-on-podman.md +++ b/content/docs/for-app-developers/how-to/special-cases/build-on-podman.md @@ -49,7 +49,7 @@ git clone https://github.com/buildpacks/samples ![](https://i.imgur.com/0mmV6K7.png) ```shell=bash -pack build sample-app -p samples/apps/ruby-bundler/ -B cnbs/sample-builder:jammy +pack build sample-app -p samples/apps/ruby-bundler/ -B cnbs/sample-builder:noble ``` Where: diff --git a/content/docs/for-app-developers/how-to/special-cases/export-to-oci-layout.md b/content/docs/for-app-developers/how-to/special-cases/export-to-oci-layout.md index 9cb16d027..71fd59fe0 100644 --- a/content/docs/for-app-developers/how-to/special-cases/export-to-oci-layout.md +++ b/content/docs/for-app-developers/how-to/special-cases/export-to-oci-layout.md @@ -51,7 +51,7 @@ The OCI layout feature must be enabled using the convention `oci: -For this guide we're actually going to use a sample builder, `cnbs/sample-builder:jammy`, which is not listed +For this guide we're actually going to use a sample builder, `cnbs/sample-builder:noble`, which is not listed as a suggested builder for good reason. It's a sample. ### 2. Build your app @@ -41,12 +41,12 @@ ls samples || git clone https://github.com/buildpacks/samples 2. Build the app ``` -pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:jammy +pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:noble ``` > **TIP:** If you don't want to keep specifying a builder every time you build, you can set it as your default -> builder by running `pack config default-builder ` for example `pack config default-builder cnbs/sample-builder:jammy` +> builder by running `pack config default-builder ` for example `pack config default-builder cnbs/sample-builder:noble` ### 3. Run it diff --git a/content/docs/for-buildpack-authors/how-to/write-buildpacks/get-started.md b/content/docs/for-buildpack-authors/how-to/write-buildpacks/get-started.md index 771a5568a..33153eba4 100644 --- a/content/docs/for-buildpack-authors/how-to/write-buildpacks/get-started.md +++ b/content/docs/for-buildpack-authors/how-to/write-buildpacks/get-started.md @@ -37,7 +37,7 @@ os = "linux" # Stacks (deprecated) the buildpack will work with [[stacks]] -id = "io.buildpacks.stacks.jammy" +id = "io.buildpacks.stacks.noble" ``` For more information, see [buildpack config](/docs/reference/config/buildpack-config). diff --git a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment.md b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment.md index e273239d1..c9f673120 100644 --- a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment.md +++ b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment.md @@ -20,7 +20,7 @@ Before we get started, make sure you've got the following installed: diff --git a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md index 51642db88..739ed387a 100644 --- a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md +++ b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md @@ -25,7 +25,7 @@ pack buildpack new examples/node-js \ --api 0.10 \ --path node-js-buildpack \ --version 0.0.1 \ - --stacks io.buildpacks.samples.stacks.jammy + --stacks io.buildpacks.samples.stacks.noble ``` This command will create `node-js-buildpack` directory which contains `buildpack.toml`, `bin/build`, `bin/detect` files. @@ -58,13 +58,13 @@ os = "linux" # Stacks (deprecated) the buildpack will work with [[stacks]] - id = "io.buildpacks.samples.stacks.jammy" + id = "io.buildpacks.samples.stacks.noble" ``` The buildpack ID is the way you will reference the buildpack when you create buildpack groups, builders, etc. [Targets](/docs/for-buildpack-authors/concepts/targets/) identifies the kind of build and run base images the buildpack will work with. -The stack ID (deprecated) uniquely identifies a build and run image configuration the buildpack will work with. This example can be run on Ubuntu Jammy. +The stack ID (deprecated) uniquely identifies a build and run image configuration the buildpack will work with. This example can be run on Ubuntu Noble. ### `detect` and `build` @@ -102,7 +102,7 @@ Set your default [builder][builder] by running the following: ```bash -pack config default-builder cnbs/sample-builder:jammy +pack config default-builder cnbs/sample-builder:noble ``` @@ -110,7 +110,7 @@ Tell pack to trust our default builder: ```bash -pack config trusted-builders add cnbs/sample-builder:jammy +pack config trusted-builders add cnbs/sample-builder:noble ``` diff --git a/content/docs/for-platform-operators/how-to/build-inputs/build-env.md b/content/docs/for-platform-operators/how-to/build-inputs/build-env.md new file mode 100644 index 000000000..7efdc32b7 --- /dev/null +++ b/content/docs/for-platform-operators/how-to/build-inputs/build-env.md @@ -0,0 +1,34 @@ ++++ +title="Specify the build time environment variables" +weight=4 ++++ + +`Environment variables` are used to configure buildpack behavior. They may be specified by: + +* The platform operator (this page) +* The end user (see [Customize buildpack behavior with build-time environment variables][end user]) +* Other buildpacks (see [Specify the environment][env]) + + + +When more than one entity specifies the same `environment variable`, the order of precedence is as shown above, with the platform operator having ultimate say over what the final value of the variable will be. + +The platform operator specifies `environment variables` in a manner that is very similar to buildpacks (see XXX), but with a few differences. Namely: + +* The directory for environment variable settings `/cnb/build-config` +* When no suffix is provided, the modification behavior is `default` +For more information, consult the [Platform Specification](https://github.com/buildpacks/spec/blob/main/platform.md). + +### Example + +Platform operators can make choices that "override" or provide defaults for application authors. In the following configuration the platform operator overrides the value of `CGO_ENABLED` for all application authors. The value of `PIP_VERBOSE` is set by default and can be overridden by buildpack authors or application authors. Any value for the environment variable `CLASSPATH` is prepended with the values provided by the platform operator. + +```bash +$ tree /cnb/buildconfig/env +├── CGO_ENABLED.override +├── PIP_VERBOSE +└── CLASSPATH.prepend +``` + +[env]: https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/specify-env/ +[end user]: https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment/ diff --git a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base.md b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base.md index 3edce4a4c..42950c201 100644 --- a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base.md +++ b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base.md @@ -17,7 +17,7 @@ We need a Dockerfile similar to the following: ```Dockerfile # Define the base image -FROM ubuntu:jammy +FROM ubuntu:noble # Install packages that we want to make available at build time RUN apt-get update && \ @@ -44,7 +44,7 @@ LABEL io.buildpacks.base.distro.version="your distro version" ### Define the base image -We start with `ubuntu:jammy` as our base image. +We start with `ubuntu:noble` as our base image. You can use any operating system, operating system distribution, and operating system distribution version of your choosing, as long as they are supported by the available buildpacks. @@ -71,5 +71,5 @@ To determine which values to provide, see [targets](/docs/for-buildpack-authors/ ## Build the build base image ```bash -docker build . -t cnbs/sample-base-build:jammy +docker build . -t cnbs/sample-base-build:noble ``` diff --git a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/builder.md b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/builder.md index 8be4d64dd..868efd7c0 100644 --- a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/builder.md +++ b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/builder.md @@ -55,20 +55,20 @@ uri = "docker://cnbs/sample-package:hello-universe" # Base images used to create the builder [build] -image = "cnbs/sample-base-build:jammy" +image = "cnbs/sample-base-build:noble" [run] [[run.images]] -image = "cnbs/sample-base-run:jammy" -mirrors = ["other-registry.example.com/cnbs/sample-base-run:jammy"] +image = "cnbs/sample-base-run:noble" +mirrors = ["other-registry.example.com/cnbs/sample-base-run:noble"] # Stack (deprecated) used to create the builder [stack] -id = "io.buildpacks.samples.stacks.jammy" +id = "io.buildpacks.samples.stacks.noble" # This image is used at runtime -run-image = "cnbs/sample-base-run:jammy" -run-image-mirrors = ["other-registry.example.com/cnbs/sample-base-run:jammy"] +run-image = "cnbs/sample-base-run:noble" +run-image-mirrors = ["other-registry.example.com/cnbs/sample-base-run:noble"] # This image is used at build-time -build-image = "cnbs/sample-base-build:jammy" +build-image = "cnbs/sample-base-build:noble" ``` ### 2. Create builder @@ -77,7 +77,7 @@ Creating a builder is now as simple as running the following command: ```bash # create builder -pack builder create my-builder:jammy --config ./builder.toml +pack builder create my-builder:noble --config ./builder.toml ``` > **TIP:** `builder create` has a `--publish` flag that can be used to publish the generated builder image to a registry. @@ -89,7 +89,7 @@ pack builder create my-builder:jammy --config ./builder.toml Let's go a little further and use our builder to [`build`][build] an app by running: ```bash -pack build my-app --builder my-builder:jammy --path samples/apps/java-maven/ +pack build my-app --builder my-builder:noble --path samples/apps/java-maven/ ``` ### 4. Running the app diff --git a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base.md b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base.md index 4d5d3788d..1e6746108 100644 --- a/content/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base.md +++ b/content/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base.md @@ -17,7 +17,7 @@ We need a Dockerfile similar to the following: ```Dockerfile # Define the base image -FROM ubuntu:jammy +FROM ubuntu:noble # Install packages that we want to make available at run time RUN apt-get update && \ @@ -40,7 +40,7 @@ LABEL io.buildpacks.base.distro.version="your distro version" ### Define the base image -We start with `ubuntu:jammy` as our base image. +We start with `ubuntu:noble` as our base image. You can use any operating system, operating system distribution, and operating system distribution version of your choosing, as long as your application will run there. @@ -62,5 +62,5 @@ To determine which values to provide, see [targets](/docs/for-buildpack-authors/ ## Build the run base image ```bash -docker build . -t cnbs/sample-base-run:jammy +docker build . -t cnbs/sample-base-run:noble ``` diff --git a/content/docs/for-platform-operators/how-to/build-inputs/stack.md b/content/docs/for-platform-operators/how-to/build-inputs/stack.md index 66c505e2d..da2f0c66b 100644 --- a/content/docs/for-platform-operators/how-to/build-inputs/stack.md +++ b/content/docs/for-platform-operators/how-to/build-inputs/stack.md @@ -30,7 +30,7 @@ Before we get started, make sure you've got the following installed: ## Creating a custom stack -We will create a sample stack based on `Ubuntu Jammy Jellyfish`. To create a custom stack, we need to create customized build and run images. +We will create a sample stack based on `Ubuntu Noble Jellyfish`. To create a custom stack, we need to create customized build and run images. To find out how, see [create a build base image](/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base/) and [create a run base image](/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base/), then come back here. ## Choose your stack ID @@ -41,10 +41,10 @@ Choose a stack ID to uniquely identify your stack. The stack ID: * should use reverse domain notation to avoid name collisions - i.e. buildpacks.io will be io.buildpacks. Example stack IDs: - * `io.buildpacks.stacks.bionic` - * `io.buildpacks.stacks.jammy` - * `io.buildpacks.samples.stacks.bionic` - * `io.buildpacks.samples.stacks.jammy` + * `io.buildpacks.stacks.noble` + * `io.buildpacks.stacks.noble` + * `io.buildpacks.samples.stacks.noble` + * `io.buildpacks.samples.stacks.noble` ## Label your images @@ -117,7 +117,7 @@ When validating whether the buildpack's mixins are satisfied by a stack, the fol ```toml [[stacks]] -id = "io.buildpacks.stacks.jammy" +id = "io.buildpacks.stacks.noble" mixins = ["build:git", "run:imagemagick", "wget"] ``` diff --git a/content/docs/for-platform-operators/tutorials/lifecycle/_index.md b/content/docs/for-platform-operators/tutorials/lifecycle/_index.md index f79c0ede7..9a69cbf4c 100644 --- a/content/docs/for-platform-operators/tutorials/lifecycle/_index.md +++ b/content/docs/for-platform-operators/tutorials/lifecycle/_index.md @@ -60,7 +60,7 @@ Now that you’re set up, let’s build our `Bash` application and dive deeper i As a starting step, you need to build the `lifecycle` in order to use its phases. This could be done by navigating to the `lifecycle` directory and executing one of the following commands, depending on your system architecture. * `make build-linux-amd64` for `AMD64` architectures (for Linux users) -* `make build-darwin-arm64` for `ARM64` architectures (for Mac users) +* `make build-darwin-arm64 && make build-linux-arm64-launcher` for `ARM64` architectures (for Mac users) @@ -175,6 +175,7 @@ In this tutorial, there is no previous `apps/bash-script` image, and the output ```text + ... Starting analyzer... Parsing inputs... @@ -182,10 +183,10 @@ Ensuring privileges... Executing command... ... Image with name "apps/bash-script" not found -Image with name "cnbs/sample-stack-run:jammy" not found -... +Image with name "cnbs/sample-stack-run:noble" not found +Timer: Analyzer ran for 41.92µs and ended at 2024-09-30T07:38:14Z Run image info in analyzed metadata is: -{"Reference":"","Image":"cnbs/sample-stack-run:jammy","Extend":false,"target":{"os":"linux","arch":"amd64"}} +{"Reference":"","Image":"cnbs/sample-stack-run:noble","Extend":false,"target":{"os":"linux","arch":"amd64"}} ``` Now if you `cat ./layers/analyzed.toml`, you should see a few null entries, a `run-image` section that records the provided name provided, and the found `os/arch`. @@ -195,7 +196,7 @@ Now if you `cat ./layers/analyzed.toml`, you should see a few null entries, a `r In this phase, the `detector` looks for an ordered group of buildpacks that will be used during the `build` phase. The `detector` requires an `order.toml` file to be provided. We can derive an order from `builder.toml` in the `samples` directory while removing the deprecated `stack` section as follows: ```text -cat "${CNB_SAMPLES_PATH}/builders/jammy/builder.toml" | grep -v -i "stack" | sed 's/\.\.\/\.\./\./' > order.toml +cat "${CNB_SAMPLES_PATH}/builders/noble/builder.toml" | grep -v -i "stack" | sed 's/\.\.\/\.\./\./' > order.toml ``` @@ -219,6 +220,7 @@ Before running the `detector`, you need to: ```command $ go install github.com/tomwright/dasel/v2/cmd/dasel@master + ``` Let’s do that for every buildpack in the `samples/buildpacks` directory: @@ -296,7 +298,7 @@ Ensuring privileges... Executing command... No run metadata found at path "/cnb/run.toml" Run image info in analyzed metadata is: -{"Reference":"","Image":"cnbs/sample-stack-run:jammy","Extend":false,"target":{"os":"linux","arch":"amd64"}} +{"Reference":"","Image":"cnbs/sample-stack-run:noble","Extend":false,"target":{"os":"linux","arch":"amd64"}} Timer: Restorer started at 2024-10-01T07:03:47Z Restoring Layer Metadata Reading buildpack directory: /tmp/example/layers/samples_hello-world @@ -473,8 +475,43 @@ Finally, you can run the exported image as follows: docker run -it apps/bash-script ./app.sh ``` +The output should look similar to the following: + ```text -OUTPUT PLACEHOLDER + + |'-_ _-'| ____ _ _ _ _ _ + | | | | _ \ (_)| | | | | | (_) + '-_|_-' | |_) | _ _ _ | | __| | _ __ __ _ ___ | | __ ___ _ ___ +|'-_ _-'|'-_ _-'| | _ < | | | || || | / _` ||'_ \ / _\ | / __|| |/ // __| | | / _ \ +| | | | | | |_) || |_| || || || (_| || |_) || (_| || (__ | < \__ \ _ | || (_) | + '-_|_-' '-_|_-' |____/ \__,_||_||_| \__,_|| .__/ \__,_| \___||_|\_\|___/(_)|_| \___/ + | | + |_| + + +Here are the contents of the current working directory: +.: +total 24 +drwxr-xr-x 3 502 dialout 4096 Jan 1 1980 . +drwxr-xr-x 1 502 root 4096 Jan 1 1980 .. +-rw-r--r-- 1 502 dialout 692 Jan 1 1980 README.md +-rwxr-xr-x 1 502 dialout 736 Jan 1 1980 app.sh +drwxr-xr-x 3 502 dialout 4096 Jan 1 1980 bash-script-buildpack +-rw-r--r-- 1 502 dialout 202 Jan 1 1980 project.toml + +./bash-script-buildpack: +total 16 +drwxr-xr-x 3 502 dialout 4096 Jan 1 1980 . +drwxr-xr-x 3 502 dialout 4096 Jan 1 1980 .. +drwxr-xr-x 2 502 dialout 4096 Jan 1 1980 bin +-rw-r--r-- 1 502 dialout 226 Jan 1 1980 buildpack.toml + +./bash-script-buildpack/bin: +total 16 +drwxr-xr-x 2 502 dialout 4096 Jan 1 1980 . +drwxr-xr-x 3 502 dialout 4096 Jan 1 1980 .. +-rwxr-xr-x 1 502 dialout 345 Jan 1 1980 build +-rwxr-xr-x 1 502 dialout 242 Jan 1 1980 detect ``` ## Wrapping up diff --git a/themes/buildpacks/static/images/pack-hello-world-nodejs.cast b/themes/buildpacks/static/images/pack-hello-world-nodejs.cast index 8c982c9c6..453c3bb92 100644 --- a/themes/buildpacks/static/images/pack-hello-world-nodejs.cast +++ b/themes/buildpacks/static/images/pack-hello-world-nodejs.cast @@ -53,9 +53,9 @@ [5.185983, "o", "Pulling image \u001b[94mregistry.fake/builders/base-builder:latest\u001b[0m\r\n"] [7.002825, "o", "latest: Pulling from /builders/base-builder\r\n"] [7.005319, "o", "Digest: sha256:0a4215114255912cd44f4d353d71b6ac9d000c4aa7d0ac2fecad32d50005c6e6\r\nStatus: Image is up to date for registry.fake/builders/base-builder:latest\r\n"] -[7.03105, "o", "Selected run image \u001b[94mcnbs/sample-stack-run:bionic\u001b[0m\r\nPulling image \u001b[94mcnbs/sample-stack-run:bionic\u001b[0m\r\n"] +[7.03105, "o", "Selected run image \u001b[94mcnbs/sample-stack-run:noble\u001b[0m\r\nPulling image \u001b[94mcnbs/sample-stack-run:noble\u001b[0m\r\n"] [8.424753, "o", "rhel7.101: Pulling from cnbs/sample-stack-run\r\n"] -[8.429182, "o", "Digest: sha256:c595029e3a1af0d2eaa722a584b85b009de10e3ea37f382e74c03d0701976123\r\nStatus: Image is up to date for cnbs/sample-stack-run:bionic\r\n"] +[8.429182, "o", "Digest: sha256:c595029e3a1af0d2eaa722a584b85b009de10e3ea37f382e74c03d0701976123\r\nStatus: Image is up to date for cnbs/sample-stack-run:noble\r\n"] [8.444506, "o", "Downloading buildpack from image: \u001b[94mregistry.fake/buildpacks/nodejs:latest\u001b[0m\r\nPulling image \u001b[94mregistry.fake/buildpacks/nodejs:latest\u001b[0m\r\n"] [9.899592, "o", "latest: "] [9.900318, "o", "Pulling from buildpacks/nodejs\r\n"] @@ -65,7 +65,7 @@ [11.83871, "o", "Adding buildpack \u001b[94mexample/yarn-install@0.0.2\u001b[0m (diffID=sha256:f57bf53c89612c3311160c3ee3269ae2722bf0458e5d931e74753b42e329471d)\r\nAdding buildpack \u001b[94mexample/yarn-start@0.0.3\u001b[0m (diffID=sha256:427c75273cda4a0c50dc6390361aaecd05adf348271ad904d5f7f357ae9bab20)\r\nAdding buildpack \u001b[94mexample/node-engine@0.0.5\u001b[0m (diffID=sha256:89fdef43b493b54a30a2dabd64ff020e11bc96dad55019a22f62975a0be57bdb)\r\nAdding buildpack \u001b[94mexample/npm-install@0.0.2\u001b[0m (diffID=sha256:22f7a9932deefd2182498b844c226f0265af561e61ecf435c1496b61e675842e)\r\nAdding buildpack \u001b[94mexample/npm-start@0.0.2\u001b[0m (diffID=sha256:e3c9a25efa16ace06627a5921a98a2fe6df2090f225542ad20ef71472aa3353d)\r\nAdding buildpack \u001b[94mexample/procfile@0.0.2\u001b[0m (diffID=sha256:6587ae66d2844fb9c1deb10fbb030f66236c2026a723be71aa2673b35aff344e)\r\n"] [11.838805, "o", "Adding buildpack \u001b[94mexample/nodejs@0.0.4\u001b[0m (diffID=sha256:664944158a8294271850e50f6b6a5e175c70620f3e8c1faa9d7a4f5b12b23ca5)\r\nAdding buildpack \u001b[94mexample/yarn@0.0.3\u001b[0m (diffID=sha256:18d9fcfcbd3ddc5c091c4dc7c0920840db9c64d3a68b7c153f43fb01746e598f)\r\n"] [14.283132, "o", "Using build cache volume \u001b[94mpack-cache-library_example_latest-f7816b8f3425.build\u001b[0m\r\nRunning the \u001b[94mcreator\u001b[0m on OS \u001b[94mlinux\u001b[0m with:\r\nContainer Settings:\r\n"] -[14.283284, "o", " Args: \u001b[94m/cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image cnbs/sample-stack-run:bionic example\u001b[0m\r\n System Envs: \u001b[94mCNB_PLATFORM_API=0.8\u001b[0m\r\n Image: \u001b[94mpack.local/builder/796d69686a7168636a6a:latest\u001b[0m\r\n User: \u001b[94mroot\u001b[0m\r\n Labels: \u001b[94mmap[author:pack]\u001b[0m\r\nHost Settings:\r\n Binds: \u001b[94mpack-cache-library_example_latest-f7816b8f3425.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-library_example_latest-f7816b8f3425.launch:/launch-cache pack-layers-ardrxkmcst:/layers pack-app-ewomqovqzg:/workspace\u001b[0m\r\n Network Mode: \u001b[94m\u001b[0m\r\n"] +[14.283284, "o", " Args: \u001b[94m/cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image cnbs/sample-stack-run:noble example\u001b[0m\r\n System Envs: \u001b[94mCNB_PLATFORM_API=0.8\u001b[0m\r\n Image: \u001b[94mpack.local/builder/796d69686a7168636a6a:latest\u001b[0m\r\n User: \u001b[94mroot\u001b[0m\r\n Labels: \u001b[94mmap[author:pack]\u001b[0m\r\nHost Settings:\r\n Binds: \u001b[94mpack-cache-library_example_latest-f7816b8f3425.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-library_example_latest-f7816b8f3425.launch:/launch-cache pack-layers-ardrxkmcst:/layers pack-app-ewomqovqzg:/workspace\u001b[0m\r\n Network Mode: \u001b[94m\u001b[0m\r\n"] [14.77181, "o", "\u001b[36m===> ANALYZING\u001b[0m\r\n"] [14.8345, "o", "Analyzing image \"d3bd4a0b0f104223fdfeff82ed35701bda03507e2f344c946717a460a74b7227\"\r\n"] [14.835838, "o", "Analyzing image \"98070ee549c522cbc08d15683d134aa0af1817fcdc56f450b07e6b4a7903f9b0\"\r\n"] diff --git a/tools/go.mod b/tools/go.mod index d07b8e09a..1029d1b14 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -132,7 +132,7 @@ require ( github.com/gohugoio/hugo-goldmark-extensions/passthrough v0.2.0 // indirect github.com/gohugoio/locales v0.14.0 // indirect github.com/gohugoio/localescompressed v1.0.1 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect diff --git a/tools/go.sum b/tools/go.sum index c3df43cd1..4123dff93 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -384,8 +384,9 @@ github.com/gohugoio/testmodBuilder/mods v0.0.0-20190520184928-c56af20f2e95 h1:sg github.com/gohugoio/testmodBuilder/mods v0.0.0-20190520184928-c56af20f2e95/go.mod h1:bOlVlCa1/RajcHpXkrUXPSHB/Re1UnlXxD1Qp8SKOd8= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=