Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand-app-developers-pages #777

Merged
1 change: 0 additions & 1 deletion content/docs/for-app-developers/concepts/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
+++
title="What are experimental features?"
weight=8
+++

Certain features are considered `experimental` and susceptible to change in a future API version.

Check warning on line 6 in content/docs/for-app-developers/concepts/experimental-features.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('are considered'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('are considered').", "location": {"path": "content/docs/for-app-developers/concepts/experimental-features.md", "range": {"start": {"line": 6, "column": 18}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

<!--more-->

This means users will need to enable the `experimental` mode in order to use one of these features.

Check warning on line 10 in content/docs/for-app-developers/concepts/experimental-features.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "content/docs/for-app-developers/concepts/experimental-features.md", "range": {"start": {"line": 10, "column": 18}}}, "severity": "WARNING"}

Check warning on line 10 in content/docs/for-app-developers/concepts/experimental-features.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'to' instead of 'in order to'. Raw Output: {"message": "[Google.WordList] Use 'to' instead of 'in order to'.", "location": {"path": "content/docs/for-app-developers/concepts/experimental-features.md", "range": {"start": {"line": 10, "column": 62}}}, "severity": "WARNING"}

To enable these features, run `pack config experimental true`, or add `experimental = true` to the `~/.pack/config.toml` file.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

For example, exporting your application to disk in `OCI` layout format is an experimental feature available on `pack` since version `v0.30.0`.

Check warning on line 14 in content/docs/for-app-developers/concepts/experimental-features.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.WordList] Use 'app' instead of 'application'. Raw Output: {"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "content/docs/for-app-developers/concepts/experimental-features.md", "range": {"start": {"line": 14, "column": 29}}}, "severity": "WARNING"}

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].

Check warning on line 25 in content/docs/for-app-developers/concepts/experimental-features.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'OCI', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'OCI', if it's unfamiliar to the audience.", "location": {"path": "content/docs/for-app-developers/concepts/experimental-features.md", "range": {"start": {"line": 25, "column": 94}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

[exp-feature]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/export-to-oci-layout/
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ 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.
Buildpacks usually define the default process type for an application, while retaining the ability for a user to specify their desired default process.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

If you are familiar with this content and would like to make a contribution, please feel free to open a PR :)
To configure the `build` to work differently from the default behavior:
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

* You first need to know what processes would be contributed by the buildpacks running in your build.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
* Once known, you can append the following flag to the `pack build` command
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

```bash
pack build --default-process <process name> <image name>` # <process name> must be a valid process name in launch.toml
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
```

If this flag is not provided by the user, `pack` will provide the process type as `web` to the `lifecycle`.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

>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.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

[Run the application]: https://buildpacks.io/docs/for-app-developers/how-to/build-outputs/specify-launch-process/
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
<!--more-->

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:
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

```bash
pack inspect-image test-node-js-app
```

You should see the following:

```text
Expand All @@ -35,4 +39,25 @@

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.

Check warning on line 42 in content/docs/for-app-developers/how-to/build-outputs/inspect-app.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('are constructed'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('are constructed').", "location": {"path": "content/docs/for-app-developers/how-to/build-outputs/inspect-app.md", "range": {"start": {"line": 42, "column": 68}}}, "severity": "INFO"}

Check warning on line 42 in content/docs/for-app-developers/how-to/build-outputs/inspect-app.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('was created'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('was created').", "location": {"path": "content/docs/for-app-developers/how-to/build-outputs/inspect-app.md", "range": {"start": {"line": 42, "column": 261}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

There are some available tools that help you achieve this and understand what is contained in your `OCI` image; a popular one is [Dive].

Check warning on line 44 in content/docs/for-app-developers/how-to/build-outputs/inspect-app.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Contractions] Use 'what's' instead of 'what is'. Raw Output: {"message": "[Google.Contractions] Use 'what's' instead of 'what is'.", "location": {"path": "content/docs/for-app-developers/how-to/build-outputs/inspect-app.md", "range": {"start": {"line": 44, "column": 74}}}, "severity": "INFO"}

Check warning on line 44 in content/docs/for-app-developers/how-to/build-outputs/inspect-app.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('is contained'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('is contained').", "location": {"path": "content/docs/for-app-developers/how-to/build-outputs/inspect-app.md", "range": {"start": {"line": 44, "column": 79}}}, "severity": "INFO"}

Check warning on line 44 in content/docs/for-app-developers/how-to/build-outputs/inspect-app.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Semicolons] Use semicolons judiciously. Raw Output: {"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "content/docs/for-app-developers/how-to/build-outputs/inspect-app.md", "range": {"start": {"line": 44, "column": 111}}}, "severity": "INFO"}
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

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.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

You can use `Dive` as follows:
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

```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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

+++
title="Run the application"
aliases=[
Expand All @@ -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 \
Expand All @@ -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
```
<!--+- "{{execute}}"+-->

The output should look similar to the below:

```
```text
Inspecting image: multi-process-app

REMOTE:
Expand Down Expand Up @@ -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
```
<!--+- "{{execute}}"+-->

>As an app developer, you can specify what the default process is, see [specify default launch process][default-process] page for more information.

hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
#### 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
```
<!--+- "{{execute interrupt}}"+-->
Expand All @@ -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
```
<!--+- "{{execute interrupt}}"+-->
Expand All @@ -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
```
<!--+- "{{execute interrupt}}"+-->
Expand All @@ -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
```
<!--+- "{{execute interrupt}}"+-->

Now let's exit this shell and run an alternative entrypoint -
```
Now let's exit this shell and run an alternative entrypoint -

```bash
exit
```
<!--+- "{{execute interrupt}}"+-->
```

```bash
docker run --rm --entrypoint launcher -it multi-process-app echo hello "$WORLD" # $WORLD is evaluated on the host machine
```
<!--+- "{{execute interrupt}}"+-->
```

```bash
docker run --rm --entrypoint launcher -it multi-process-app echo hello '$WORLD' # $WORLD is evaluated in the container after profile scripts are sourced
```
<!--+- "{{execute interrupt}}"+-->
Expand All @@ -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'
```
<!--+- "{{execute interrupt}}"+-->
Expand All @@ -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`
Expand All @@ -155,11 +160,12 @@ 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
```
<!--+- "{{execute interrupt}}"+-->

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/
Original file line number Diff line number Diff line change
Expand Up @@ -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.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved

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.
hyounes4560 marked this conversation as resolved.
Show resolved Hide resolved
natalieparellano marked this conversation as resolved.
Show resolved Hide resolved
Loading