Skip to content

Commit

Permalink
reorganizes a section
Browse files Browse the repository at this point in the history
Signed-off-by: Hanan Younes <[email protected]>
  • Loading branch information
hyounes4560 committed Aug 15, 2024
1 parent 4efbd42 commit 29de803
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ Environment variables are a common way to configure buildpacks at build-time and

<!--more-->

When `clear-env` is not set to `true`, the `lifecycle` MUST set user-provided environment variables in the environment of `/bin/detect` or `/bin/build` such that:

* For layer path environment variables, user-provided values are prepended before any existing values and are delimited by the OS path list separator.
* For all other environment variables, user-provided values override any existing values.
* The environment variable prefix `CNB_` is reserved. It MUST NOT be used for environment variables that are not defined in this specification or approved extensions.

### Preparing the environment at build time

When the `lifecycle` runs each buildpack, it first tears down any environment variables defined on the `build-time` base image of the environment. It only allows a [specific set](https://github.com/buildpacks/lifecycle/blob/a43d5993a4f2cc23c44b6480ba2ab09fe81d57ed/env/build.go#L9-L19) of pre-configured environment variables through.
Expand Down Expand Up @@ -138,6 +132,14 @@ Assuming that `some-buildpack-id` comes before `some-other-buildpack-id` in the

>For more information on modifying environment variables, see [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules) specification.
Please note that when `clear-env` is not set to `true`, the `lifecycle` MUST set user-provided environment variables in the environment of `/bin/detect` or `/bin/build` such that:

* For layer path environment variables, user-provided values are prepended before any existing values and are delimited by the OS path list separator.
* For all other environment variables, user-provided values override any existing values.
* The environment variable prefix `CNB_` is reserved. It MUST NOT be used for environment variables that are not defined in this specification or approved extensions.

>For more information on clearing user-defined environment variables, see [Clear the buildpack environment](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/clear-env/) documentation.
### Further reading

For more about environment variables, see the [customize buildpack behavior with build-time environment variables](https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment/) documentation and the [Environment](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment) specification.

0 comments on commit 29de803

Please sign in to comment.