diff --git a/content/docs/for-buildpack-authors/how-to/write-buildpacks/specify-launch-processes.md b/content/docs/for-buildpack-authors/how-to/write-buildpacks/specify-launch-processes.md index 6146d716a..1f7026ec0 100644 --- a/content/docs/for-buildpack-authors/how-to/write-buildpacks/specify-launch-processes.md +++ b/content/docs/for-buildpack-authors/how-to/write-buildpacks/specify-launch-processes.md @@ -7,6 +7,39 @@ One of the benefits of buildpacks is that they are multi-process - an image can +A `process type` is a named process definition, contributed by a buildpack at build-time and executed by the launcher at run-time. +Buildpacks declare process types during the build phase by writing entries into `/launch.toml`. + +## Key Points + +For each process, the buildpack: + +* MUST specify a `type`, an identifier for the process, which: + * MUST NOT be identical to other process types provided by the same buildpack. + * MUST only contain numbers, letters, and the characters `.`, `_`, and `-`. +* MUST specify a `command` list such that: + * The first element of `command` is a path to an executable or the file name of an executable in `$PATH`. + * Any remaining elements of `command` are arguments that are always passed directly to the executable [^command-args]. +* MAY specify an `args` list to be passed directly to the specified executable, after arguments specified in `command`. + * The `args` list is a default list of arguments that may be overridden by the user [^command-args]. +* MAY specify a `default` boolean that indicates that the process type should be selected as the [buildpack-provided default](https://github.com/buildpacks/spec/blob/main/platform.md#outputs-4) during the export phase. +* MAY specify a `working-dir` for the process. The `working-dir` defaults to the application directory if not specified. + +## Implementation Steps + +Processes are added to the `launch.toml` file in the `/` directory as follows: + +```toml +[[processes]] +type = "" +command = [""] +args = [""] +default = false +working-dir = "" +``` + +### Examples + Let's see how this works. We will specify a process type that allows a debugger to attach to our application. To enable running the debug process, we'll need to have our buildpack define a "process type" for the worker. diff --git a/content/docs/for-buildpack-authors/how-to/write-buildpacks/use-exec.d.md b/content/docs/for-buildpack-authors/how-to/write-buildpacks/use-exec.d.md index c09322391..cedc525bd 100644 --- a/content/docs/for-buildpack-authors/how-to/write-buildpacks/use-exec.d.md +++ b/content/docs/for-buildpack-authors/how-to/write-buildpacks/use-exec.d.md @@ -13,7 +13,7 @@ The [buildpacks `exec.d` interface](https://github.com/buildpacks/spec/blob/main 2. Script Behavior: * **Inputs** - *A third open file descriptor. File descriptors are integers used by a process to uniquely identify opened files; pre-opened file descriptors are usually 0 for stdin, 1 for stdout and 2 for stderr. The third open file descriptor is inherited from the calling process. + * A third open file descriptor. File descriptors are integers used by a process to uniquely identify opened files; pre-opened file descriptors are usually `0` for `stdin`, `1` for `stdout` and `2` for `stderr`. The third open file descriptor is inherited from the calling process. * **Outputs** * Valid TOML describing environment variables in the form of key=value pairs. These variables are added to the application's runtime environment. The content should be written to file descriptor 3 (see examples for how to do this). * Exit Code: The scripts should exit with a status code of `0` to indicate success. A non-zero exit code will indicate an error and prevent the application from launching.