From e511194e9586c95db3d469b08addf8f675d0822b Mon Sep 17 00:00:00 2001 From: Hanan Younes <56159764+hyounes4560@users.noreply.github.com> Date: Mon, 4 Nov 2024 03:17:35 -0500 Subject: [PATCH] adds platform environment variables related content from the spec (#771) * adds platform env var related content from the spec Signed-off-by: Hanan Younes --------- Signed-off-by: Hanan Younes --- .../how-to/build-inputs/build-env.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 content/docs/for-platform-operators/how-to/build-inputs/build-env.md 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/