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

[RFC #0096] Lifecycle should provide CNB_TARGET_ID in buildpack env #743

Closed
Tracked by #219
buildpack-bot opened this issue Oct 6, 2021 · 2 comments · Fixed by #994
Closed
Tracked by #219

[RFC #0096] Lifecycle should provide CNB_TARGET_ID in buildpack env #743

buildpack-bot opened this issue Oct 6, 2021 · 2 comments · Fixed by #994
Labels
good first issue A good first issue to get started with.

Comments

@buildpack-bot
Copy link
Member

buildpack-bot commented Oct 6, 2021

Spec PR: buildpacks/spec#336

The following environment variables MUST be set by the lifecycle during detect and build phases to describe the target runtime image (this information is read from analyzed.toml).

Env Variable Description
CNB_TARGET_ID Identifier for the target image (optional)
CNB_TARGET_OS Target OS
CNB_TARGET_ARCH Target architecture
CNB_TARGET_VARIANT Target architecture variant (optional)
CNB_TARGET_DISTRO_NAME Target OS distribution name (optional)
CNB_TARGET_DISTRO_VERISON Target OS distribution version (optional)

If any buildpack in a group fails to declare a target in buildpack.toml matching the build-time and runtime base images, the lifecycle MUST fail detection for the group. Note that the build-time info is not known by the lifecycle and is validated by the platform.

If an (older) buildpack does not declare target data in buildpack.toml BUT it sets stacks.id = "io.buildpacks.stacks.bionic, the lifecycle will translate this to:

[[targets]]
os = "linux"
arch = "x86_64"
[[targets.distributions]]
name = "ubuntu"
versions = ["18.04"]

and use that for the validation.

The schema for analyzed.toml:

[run-image]
  reference = "<image reference>"
  [target]
  id = "<target identifer>"
  os = "<OS name>"
  arch = "<architecture>"
  variant = "<architecture variant>"
  [target.distribution]
  name = "<OS distribution name>"
  version = "<OS distribution version>"
@natalieparellano natalieparellano added this to the lifecycle-0.15.0 milestone Feb 25, 2022
@natalieparellano natalieparellano added the good first issue A good first issue to get started with. label Mar 30, 2022
@natalieparellano
Copy link
Member

This should probably happen for detect also.

@natalieparellano natalieparellano removed this from the lifecycle-0.15.0 milestone Nov 3, 2022
@natalieparellano natalieparellano changed the title [RFC #0096] Builder should provide CNB_TARGET_ID in buildpack env [RFC #0096] Lifecycle should provide CNB_TARGET_ID in buildpack env Jan 9, 2023
@joe-kimmel-vmw
Copy link
Contributor

oh yeah, so i'm totally slowly working on this. can anyone assign me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good first issue to get started with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants