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

Adds Build time and runtime images content to the Platform docs #770

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hyounes4560
Copy link
Contributor

  • adds build and run images content under the platform section

@hyounes4560 hyounes4560 requested a review from a team as a code owner September 28, 2024 17:29
Signed-off-by: Hanan Younes <[email protected]>
Copy link
Member

@AidanDelaney AidanDelaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly questions about terminology.


<!--more-->

Each buildpack checks the source code and provides any relevant dependencies. Then, a `base image` is then generated from the application’s source code and these dependencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "base image" the correct term here? We've used "application image" in the past to refer to the final output image.

Comment on lines +29 to +30
* The image config's `User` field is set to a non-root user with a writable home directory
* The image config's `Env` field has the environment variable `CNB_USER_ID` set to the user [UID/SID](https://github.com/buildpacks/spec/blob/main/README.md#operating-system-conventions) of the user specified in the `User` field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may have to explain what is meant by "User field" and "Env field". Do we mean user and environment here? i.e. that the build image must have a non-root user and CNB_USER_ID is an environment variable which contains the uid of that user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think we should avoid copy/pasting the spec into the docs. Then we just have two things to maintain. This section should provide some grounding for understanding the spec, and then link to it. Let's think about how to frame this and then provide a code suggestion.


The platform must ensure that:

* The image config's `Env` field has the environment variable `PATH` set to a valid set of paths or explicitly set to empty (`PATH=`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I wonder if "Env field" is the correct term here. Do we mean that the run image must define a PATH environment variable?


#### Anatomy of a run image

A `runtime` image may contain:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between the "run image" and a "runtime" image?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nothing... I think we decided to use "runtime base image" as opposed to "run image" because the latter was more of a CNB construct whereas the former would be recognized more widely.

@@ -0,0 +1,94 @@
+++
title="Base image types"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we name this file base-images.md? I think that would make more sense

weight=99
+++

As you already know, `Cloud Native Buildpacks (CNBs)` transform your application source code into `OCI images` that can run on any cloud and include all of the components your application needs to build and run and.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As you already know, `Cloud Native Buildpacks (CNBs)` transform your application source code into `OCI images` that can run on any cloud and include all of the components your application needs to build and run and.
As you already know, `Cloud Native Buildpacks (CNBs)` transform your application source code into `OCI images` that can run on any cloud.


<!--more-->

Each buildpack checks the source code and provides any relevant dependencies. Then, a `base image` is then generated from the application’s source code and these dependencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each buildpack checks the source code and provides any relevant dependencies. Then, a `base image` is then generated from the application’s source code and these dependencies.
Each buildpack checks the source code and provides any relevant dependencies in the form of layers. Then, buildpack-provided layers are placed atop a runtime `base image` to form the final application image.


### Build image

A `build image` is an `OCI image` that serves as the base image for the `build` environment in which buildpacks `lifecycle` is executed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A `build image` is an `OCI image` that serves as the base image for the `build` environment in which buildpacks `lifecycle` is executed.
A `build image` is an `OCI image` that serves as the base image for the `build` environment in which the CNB `lifecycle` and buildpacks are executed.


#### Anatomy of a run image

A `runtime` image may contain:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nothing... I think we decided to use "runtime base image" as opposed to "run image" because the latter was more of a CNB construct whereas the former would be recognized more widely.

Comment on lines +29 to +30
* The image config's `User` field is set to a non-root user with a writable home directory
* The image config's `Env` field has the environment variable `CNB_USER_ID` set to the user [UID/SID](https://github.com/buildpacks/spec/blob/main/README.md#operating-system-conventions) of the user specified in the `User` field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think we should avoid copy/pasting the spec into the docs. Then we just have two things to maintain. This section should provide some grounding for understanding the spec, and then link to it. Let's think about how to frame this and then provide a code suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants