Skip to content

Commit

Permalink
Merge branch 'main' into add-platform-env-related-page
Browse files Browse the repository at this point in the history
  • Loading branch information
hyounes4560 authored Oct 26, 2024
2 parents a51eed2 + 7eeca60 commit 4c5b59b
Show file tree
Hide file tree
Showing 10 changed files with 518 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .github/styles/config/vocabularies/Buildpacks/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
API(?s)
[Bb]uildpack(?s)
config
Dockerfile(?s)
GitHub
mixin(?s)
prepended
rebase
Rebasing
SBOM(?s)
semver
Syft
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
name: public
path: ./public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vale-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: errata-ai/vale-action@reviewdog
- uses: errata-ai/vale-action@v2.1.1
with:
fail_on_error: true
token: ${{secrets.GITHUB_TOKEN}}
Expand Down
2 changes: 0 additions & 2 deletions .vale/styles/confg/vocabularies/Buildpacks/accept.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ weight=1
<!--more-->

Building for the ARM architecture is now easier than ever! The `heroku/builder:24` builder supports both AMD64 and ARM64 architectures, and includes
multi-arch Go, Java, Node.js, PHP, Python, Ruby and Scala buildpacks. You can read more about Heroku's [Cloud Native Buildpacks here][heroku-buildpacks].
multi-arch .NET, Go, Java, Node.js, PHP, Python, Ruby and Scala buildpacks. You can read more about Heroku's [Cloud Native Buildpacks here][heroku-buildpacks].

> **NOTE:** Our current multi-architecture support allows building an ARM64 application image on an ARM64 host, and building an AMD64 application image on an AMD64 host. We do not currently support building an application image for one architecture on a different architecture. However, if your host machine supports emulation (e.g., with QEMU) you may be able to perform cross platform builds, albeit with a performance penalty.
Expand Down
57 changes: 57 additions & 0 deletions content/docs/for-platform-operators/concepts/base-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
+++
title="Base image types"
weight=99
+++

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 in the form of layers. Then, buildpack-provided layers are placed atop a runtime `base image` to form the final application image.

## Base image types

A `base image` is an `OCI image` containing the base, or initial set of layers, for other images. It is helpful to distinguish between two distinct types of images, `Build` and `Runtime` images.

### Build image

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.

A typical `build image` might determine:

* The OS distro in the build environment
* OS packages installed in the build environment
* Trusted CA certificates in the build environment
* The default user in the build environment

#### Anatomy of a build image

Typically, a `build` image may include:

* Shell
* C-compiler
* Minimal operating system distribution, such as Linux utilities that build systems might call out to
* Build time libraries

### Runtime image

A `runtime image` is an `OCI image` that serves as the base image for the final application image.

A typical runtime image might determine:

* The OS distro or distroless OS in the launch environment
* OS packages installed in the launch environment
* Trusted CA certificates in the launch environment
* The default user in the run environment

#### Anatomy of a runtime base image

A `runtime` image may contain:

* No-shell, unless it's needed by the application
* Runtime libraries, such as Libfreetype
* Runtime platforms, such as python interpreter, which are generally added by buildpacks

For more details on `build` and `runtime` images, you can check out the [specification][spec]

[spec]: https://github.com/buildpacks/spec/blob/main/platform.md#build-image
7 changes: 4 additions & 3 deletions content/docs/for-platform-operators/concepts/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ A builder consists of the following components:

* [Buildpacks][buildpack]
* A [lifecycle][lifecycle]
* A [build image](/docs/for-app-developers/concepts/base-images/build/)
* A reference to a [run image](/docs/for-app-developers/concepts/base-images/run/)
* A [build image][build-image]
* A reference to a [run image][run-image]

### Resources

To learn how to create your own builder, see our [Operator's Guide][operator-guide].

[builder-config]: /docs/reference/builder-config/
[buildpack]: /docs/for-platform-operators/concepts/buildpack/
[lifecycle]: /docs/for-platform-operators/concepts/lifecycle/
[operator-guide]: /docs/for-platform-operators/
[build-image]: /docs/for-platform-operators/concepts/base-images
[run-image]: /docs/for-platform-operators/concepts/base-images
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This information is used during the `export` phase in order to avoid re-uploadin
Starting from `Platform API 0.7`, the `analyze` phase runs before the `detect` phase in order to validate registry access for all images that are used during the `build` as early as possible. In this way it provides faster failures for end users. The other responsibilities of the `analyzer` were moved to the `restorer`.\
For more information, please see [this migration guide][platform-api-06-07-migration].

The `lifecycle` should attempt to locate a reference to the latest `OCI image` from a previous build that is readable and was created by the `lifecycle` using the same application source code. If no such reference is found, the `analysis` is skipped.\
The `lifecycle` should attempt to locate a reference to the latest `OCI image` from a previous build that is readable and was created by the `lifecycle` using the same application source code. If no such reference is found, the `analysis` is skipped.

The `lifecycle` must write [analysis metadata][analyzedtoml-toml] to `<analyzed>`, where:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ FROM ubuntu:jammy
# Install packages that we want to make available at run time
RUN apt-get update && \
apt-get install -y xz-utils ca-certificates && \
rm -rf /var/lib/apt/lists/* \
rm -rf /var/lib/apt/lists/*

# Create user and group
ARG cnb_uid=1000
ARG cnb_gid=1000
RUN groupadd cnb --gid ${cnb_gid} && \
useradd --uid ${cnb_uid} --gid ${cnb_gid} -m -s /bin/bash cnb \
useradd --uid ${cnb_uid} --gid ${cnb_gid} -m -s /bin/bash cnb

# Set user and group
USER ${cnb_uid}:${cnb_gid}
Expand Down
Loading

0 comments on commit 4c5b59b

Please sign in to comment.