From fa2c7bfefa59a76cc44104f6fd802992056b5443 Mon Sep 17 00:00:00 2001 From: Hanan Younes Date: Sun, 27 Oct 2024 21:18:38 -0400 Subject: [PATCH 1/4] adds content to 2 app developer pages Signed-off-by: Hanan Younes --- .../concepts/experimental-features.md | 18 ++++++++++++++++++ .../build-outputs/understand-failures.md | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 content/docs/for-app-developers/concepts/experimental-features.md 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..b50c6340c --- /dev/null +++ b/content/docs/for-app-developers/concepts/experimental-features.md @@ -0,0 +1,18 @@ ++++ +title="What are experimental features?" +weight=8 ++++ + +Certain features are considered `experimental` and susceptible to change in a future API version. + + + +This means users will need to enable the `experimental` mode in order to use one of these feature. + +To enable these features, run `pack config experimental true`, or add `experimental = true` to the `~/.pack/config.toml` file. + +For example, exporting your application to disk in `OCI` layout format is an experimental feature available on `pack` since version `v0.30.0` + +For more information and to look at an example of how this might be valuable, see [Export to OCI layout format on disk][exp-feature]. + +[exp-feature]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/export-to-oci-layout/ 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..e77e17f63 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,6 @@ 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 applications' 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 explores some of the most common issues that may prevent image build completion and provides troubleshooting tips to help end-users navigate these issues. From f714d5e0170442df374655c4e78732f21e940b9f Mon Sep 17 00:00:00 2001 From: Hanan Younes Date: Sat, 9 Nov 2024 17:35:17 -0500 Subject: [PATCH 2/4] adds dive and layers content Signed-off-by: Hanan Younes --- .../docs/for-app-developers/concepts/build.md | 1 - .../how-to/build-outputs/inspect-app.md | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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/how-to/build-outputs/inspect-app.md b/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md index 3d97b4288..165d940f0 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,15 +8,19 @@ 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 built-in command to help you inspect the resultant image and view some of its contents as shown below: + ```bash pack inspect-image test-node-js-app ``` + You should see the following: ```text @@ -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]. +As already mentioned, buildpacks help you get an `OCI` images that are constructed in a way that’s easy to understand and update 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 some available tools that 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, 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 understand what is in 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 From 4178e77faca941836a84af44005cf80be20a5e91 Mon Sep 17 00:00:00 2001 From: Hanan Younes Date: Tue, 12 Nov 2024 08:54:03 -0500 Subject: [PATCH 3/4] adds exp. features list Signed-off-by: Hanan Younes --- .../concepts/experimental-features.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/content/docs/for-app-developers/concepts/experimental-features.md b/content/docs/for-app-developers/concepts/experimental-features.md index b50c6340c..a73274c64 100644 --- a/content/docs/for-app-developers/concepts/experimental-features.md +++ b/content/docs/for-app-developers/concepts/experimental-features.md @@ -7,11 +7,20 @@ Certain features are considered `experimental` and susceptible to change in a fu -This means users will need to enable the `experimental` mode in order to use one of these feature. +This means users will need to enable the `experimental` mode in order to use one of these features. To enable these features, run `pack config experimental true`, or add `experimental = true` to the `~/.pack/config.toml` file. -For example, exporting your application to disk in `OCI` layout format is an experimental feature available on `pack` since version `v0.30.0` +For example, exporting your application to disk in `OCI` layout format is an experimental feature available on `pack` since version `v0.30.0`. + +The following is a list of experimental features: + +* Image extensions +* Windows extensions +* Windows containers +* Windows buildpackage +* Buildpack registry +* Flattening a buildpack package For more information and to look at an example of how this might be valuable, see [Export to OCI layout format on disk][exp-feature]. From ea3553afadac2a71d9ce42307415e4c1d953a6a7 Mon Sep 17 00:00:00 2001 From: Hanan Younes Date: Wed, 13 Nov 2024 18:50:27 -0500 Subject: [PATCH 4/4] adds reviewers feedback Signed-off-by: Hanan Younes --- .../concepts/experimental-features.md | 33 ++++++++++++------- .../specify-default-launch-process.md | 14 +++----- .../how-to/build-outputs/inspect-app.md | 10 +++--- .../build-outputs/specify-launch-process.md | 2 +- .../build-outputs/understand-failures.md | 33 +++++++++++++++++-- 5 files changed, 63 insertions(+), 29 deletions(-) diff --git a/content/docs/for-app-developers/concepts/experimental-features.md b/content/docs/for-app-developers/concepts/experimental-features.md index a73274c64..a989a05e5 100644 --- a/content/docs/for-app-developers/concepts/experimental-features.md +++ b/content/docs/for-app-developers/concepts/experimental-features.md @@ -3,25 +3,34 @@ title="What are experimental features?" weight=8 +++ -Certain features are considered `experimental` and susceptible to change in a future API version. +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. -To enable these features, run `pack config experimental true`, or add `experimental = true` to the `~/.pack/config.toml` file. +If using `pack`, run `pack config experimental true`, or add `experimental = true` to your `~/.pack/config.toml` file to enable experimental features. -For example, exporting your application to disk in `OCI` layout format is an experimental feature available on `pack` since version `v0.30.0`. +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 is a list of experimental features: +The following features are experimental for `pack`: -* Image extensions -* Windows extensions -* Windows containers -* Windows buildpackage -* Buildpack registry -* Flattening a buildpack package +* 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] -For more information and to look at an example of how this might be valuable, see [Export to OCI layout format on disk][exp-feature]. +The following features are experimental for `lifecycle`: -[exp-feature]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/export-to-oci-layout/ +* 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/specify-default-launch-process.md b/content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md index a38a8294e..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,19 +4,15 @@ weight=99 summary="Buildpacks can define multiple processes for an application image. Specify which process should be the default." +++ -Buildpacks usually define the default process type for an application, while retaining the ability for a user to specify their desired default process. +While buildpacks usually define the default process type for an application, end users may specify the desired default process. -To configure the `build` to work differently from the default behavior: +To specify the default process: -* You first need to know what processes would be contributed by the buildpacks running in your build. -* Once known, you can append the following flag to the `pack build` command +* 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 in launch.toml +pack build --default-process ` # must be a valid process name ``` -If this flag is not provided by the user, `pack` will provide the process type as `web` to the `lifecycle`. - ->As an app developer, you can specify the default process for an application. However, buildpacks-built images can contain multiple process types, to see how to invoke each one, see the [Run the application] page. - [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-outputs/inspect-app.md b/content/docs/for-app-developers/how-to/build-outputs/inspect-app.md index f40972ed8..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 @@ -15,7 +15,7 @@ Information includes: * Whether the run-image can be rebased with a new version through the `Rebasable` label or not * And more...! -`Pack` offers a built-in command to help you inspect the resultant image and view some of its contents as shown below: +`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 @@ -39,13 +39,13 @@ 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]. -As already mentioned, buildpacks help you get an `OCI` images that are constructed in a way that’s easy to understand and update 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. +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 some available tools that help you achieve this and understand what is contained in your `OCI` image; a popular one is [Dive]. +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, 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 understand what is in each layer. +`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: +You can use `dive` as follows: ```bash dive 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 b099da27b..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 @@ -81,7 +81,7 @@ docker run --rm -p 8080:8080 multi-process-app ``` ->As an app developer, you can specify what the default process is, see [specify default launch process][default-process] page for more information. +>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 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 e77e17f63..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." +++ -While `Buildpacks` help developers transform applications' source code into container images that can run on any cloud, creating an error-free experience remains far from achieved. +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. -This guide explores some of the most common issues that may prevent image build completion and provides troubleshooting tips to help end-users navigate these issues. +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