├── .slugignore ├── CODEOWNERS ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── config.yml │ └── docs-request.md ├── styles │ └── config │ │ └── vocabularies │ │ └── Buildpacks │ │ └── accept.txt ├── dependabot.yml ├── PR_TEMPLATE.md ├── workflows │ ├── vale-lint.yml │ └── main.yml └── bug_report.md ├── content ├── docs │ ├── reference │ │ ├── config │ │ │ ├── _index.md │ │ │ └── package-config.md │ │ ├── _index.md │ │ └── spec │ │ │ ├── _index.md │ │ │ ├── distribution-api.md │ │ │ ├── platform-api.md │ │ │ └── buildpack-api.md │ ├── for-app-developers │ │ ├── how-to │ │ │ ├── _index.md │ │ │ ├── build-inputs │ │ │ │ ├── _index.md │ │ │ │ ├── specify-default-launch-process.md │ │ │ │ ├── specify-export-target.md │ │ │ │ └── use-inline-buildpacks.md │ │ │ ├── build-outputs │ │ │ │ ├── _index.md │ │ │ │ ├── download-sbom.md │ │ │ │ ├── understand-failures.md │ │ │ │ └── inspect-app.md │ │ │ └── special-cases │ │ │ │ ├── _index.md │ │ │ │ ├── build-for-windows.md │ │ │ │ └── build-for-arm.md │ │ ├── concepts │ │ │ ├── _index.md │ │ │ ├── base-images │ │ │ │ ├── _index.md │ │ │ │ ├── build.md │ │ │ │ ├── run.md │ │ │ │ └── stack.md │ │ │ ├── build.md │ │ │ ├── rebase.md │ │ │ ├── platform.md │ │ │ ├── builder.md │ │ │ └── experimental-features.md │ │ ├── _index.md │ │ └── tutorials │ │ │ └── _index.md │ ├── for-buildpack-authors │ │ ├── how-to │ │ │ ├── _index.md │ │ │ ├── migrate │ │ │ │ ├── _index.md │ │ │ │ ├── deprecated │ │ │ │ │ ├── _index.md │ │ │ │ │ ├── buildpack-api-0.4-0.5.md │ │ │ │ │ └── buildpack-api-0.6-0.7.md │ │ │ │ ├── buildpack-api-0.8-0.9.md │ │ │ │ ├── buildpack-api-0.7-0.8.md │ │ │ │ └── buildpack-api-0.9-0.10.md │ │ │ ├── write-buildpacks │ │ │ │ ├── _index.md │ │ │ │ ├── create-slice-layers.md │ │ │ │ ├── create-layer.md │ │ │ │ ├── add-labels.md │ │ │ │ ├── add-sbom.md │ │ │ │ ├── re-use-layers.md │ │ │ │ └── specify-launch-processes.md │ │ │ ├── write-extensions │ │ │ │ └── _index.md │ │ │ └── distribute-buildpacks │ │ │ │ ├── craft-order.md │ │ │ │ ├── publish-buildpack │ │ │ │ └── _index.md │ │ │ │ └── package-buildpack.md │ │ ├── concepts │ │ │ ├── _index.md │ │ │ ├── package.md │ │ │ ├── targets.md │ │ │ └── component-buildpack.md │ │ ├── tutorials │ │ │ ├── _index.md │ │ │ ├── basic-buildpack │ │ │ │ ├── _index.md │ │ │ │ └── 03_detection.md │ │ │ └── basic-extension │ │ │ │ ├── _index.md │ │ │ │ ├── 03_building-blocks-extension.md │ │ │ │ └── 01_setup-local-environment.md │ │ └── _index.md │ ├── for-platform-operators │ │ ├── concepts │ │ │ ├── _index.md │ │ │ ├── lifecycle │ │ │ │ ├── rebase.md │ │ │ │ ├── launch.md │ │ │ │ ├── build.md │ │ │ │ ├── create.md │ │ │ │ ├── export.md │ │ │ │ ├── analyze.md │ │ │ │ └── extend.md │ │ │ ├── builder.md │ │ │ └── base-images.md │ │ ├── how-to │ │ │ ├── _index.md │ │ │ ├── migrate │ │ │ │ ├── _index.md │ │ │ │ ├── deprecated │ │ │ │ │ ├── _index.md │ │ │ │ │ ├── platform-api-0.6-0.7.md │ │ │ │ │ ├── platform-api-0.5-0.6.md │ │ │ │ │ ├── platform-api-0.3-0.4.md │ │ │ │ │ └── platform-api-0.4-0.5.md │ │ │ │ └── platform-api-0.8-0.9.md │ │ │ ├── build-inputs │ │ │ │ ├── _index.md │ │ │ │ ├── create-builder │ │ │ │ │ ├── _index.md │ │ │ │ │ ├── extensions.md │ │ │ │ │ ├── run-base.md │ │ │ │ │ └── build-base.md │ │ │ │ └── build-env.md │ │ │ └── integrate-ci │ │ │ │ ├── _index.md │ │ │ │ ├── pack │ │ │ │ ├── cli │ │ │ │ │ └── _index.md │ │ │ │ ├── concepts │ │ │ │ │ └── _index.md │ │ │ │ └── _index.md │ │ │ │ ├── gitlab.md │ │ │ │ ├── circleci.md │ │ │ │ ├── piper.md │ │ │ │ └── kpack.md │ │ ├── _index.md │ │ └── tutorials │ │ │ └── _index.md │ └── .common │ │ └── concepts │ │ ├── composite-buildpack.md │ │ └── buildpack.md └── features.md ├── tools ├── tools.go └── get_pack_commands.go ├── themes └── buildpacks │ ├── layouts │ ├── _default │ │ ├── list.html │ │ ├── single.html │ │ ├── standalone.html │ │ ├── community.html │ │ └── baseof.html │ ├── partials │ │ ├── footline.html │ │ ├── support.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── meta.html │ │ ├── sidebar.html │ │ └── docs.html │ └── shortcodes │ │ ├── summary.html │ │ ├── feature.html │ │ ├── download-button.html │ │ ├── page-replace-toggle-option.html │ │ ├── pack-version.html │ │ ├── tab.html │ │ ├── page-replace-toggle.html │ │ ├── tabs.html │ │ ├── podman-setup.html │ │ └── pack-install.html │ ├── static │ └── images │ │ ├── ko.png │ │ ├── build.png │ │ ├── cve.png │ │ ├── jib.png │ │ ├── analyze.png │ │ ├── detect.png │ │ ├── docker.png │ │ ├── export.png │ │ ├── favicon.png │ │ ├── history.png │ │ ├── bg-pattern.png │ │ ├── openshift.png │ │ ├── lifecycle-phases.png │ │ ├── buildpacks-social-card.jpg │ │ ├── registry-add-buildpack.png │ │ ├── buildpacks-social-card-square.jpg │ │ ├── github-mark.svg │ │ ├── download-icon.svg │ │ ├── list-item-active.svg │ │ ├── slack-mark.svg │ │ ├── list-item.svg │ │ └── learn-icon.svg │ ├── assets │ └── scss │ │ ├── components │ │ ├── _lists.scss │ │ ├── _footline.scss │ │ ├── _well.scss │ │ ├── _grid.scss │ │ ├── _highlights.scss │ │ ├── _talks.scss │ │ ├── _text-note.scss │ │ ├── _header.scss │ │ ├── _content.scss │ │ ├── _tabs.scss │ │ ├── _table.scss │ │ ├── _code.scss │ │ ├── _quote.scss │ │ ├── _calendar.scss │ │ ├── _sidebar.scss │ │ ├── _footer.scss │ │ ├── _hero.scss │ │ └── _button.scss │ │ ├── _layout.scss │ │ ├── _helpers.scss │ │ ├── _base.scss │ │ ├── _code.scss │ │ ├── site.scss │ │ ├── _colors.scss │ │ └── _typography.scss │ └── theme.toml ├── .editorconfig ├── archetypes └── default.md ├── app.json ├── .vale.ini ├── data └── calendar.yml ├── .gitignore ├── .gitpod.yml ├── DEVELOPMENT.md ├── README.md └── RELEASE.md /.slugignore: -------------------------------------------------------------------------------- 1 | /src 2 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @buildpacks/learning-maintainers 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @buildpacks/learning-maintainers 2 | -------------------------------------------------------------------------------- /content/docs/reference/config/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Configuration" 3 | include_summaries=true 4 | +++ -------------------------------------------------------------------------------- /content/docs/reference/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Reference" 3 | weight=99 4 | include_summaries=true 5 | 6 | +++ -------------------------------------------------------------------------------- /tools/tools.go: -------------------------------------------------------------------------------- 1 | // +build tools 2 | 3 | package tools 4 | 5 | import ( 6 | _ "github.com/gohugoio/hugo" 7 | ) 8 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="How To" 3 | weight=3 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Concepts" 3 | weight=2 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="How To" 3 | weight=3 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Concepts" 3 | weight=2 4 | include_summaries=true 5 | +++ -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="How To" 3 | weight=3 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 | {{ partial "docs.html" . }} 4 | 5 | {{ end }} 6 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 | {{ partial "docs.html" . }} 4 | 5 | {{ end }} 6 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/ko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/ko.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 2 4 | 5 | [Makefile] 6 | indent_style = tab 7 | indent_size = 4 8 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/concepts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Concepts" 3 | weight=2 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/build.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/cve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/cve.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/jib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/jib.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/analyze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/analyze.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/detect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/detect.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/docker.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/export.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/favicon.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/history.png -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildpacks": [ 3 | { 4 | "url": "https://github.com/heroku/heroku-buildpack-static.git" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Migrate" 3 | weight=99 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Migrate" 3 | weight=99 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_lists.scss: -------------------------------------------------------------------------------- 1 | ul.list-circle { 2 | > li { 3 | list-style-type: circle !important; 4 | } 5 | } -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/footline.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ partial "support.html" . }} 4 |
5 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/bg-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/bg-pattern.png -------------------------------------------------------------------------------- /themes/buildpacks/static/images/openshift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/openshift.png -------------------------------------------------------------------------------- /content/docs/for-app-developers/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="For App Developers" 3 | weight=1 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Tutorials" 3 | weight=1 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Tutorials" 3 | weight=1 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/summary.html: -------------------------------------------------------------------------------- 1 | {{- $page := .Get 0 -}} 2 | {{- with .Site.GetPage $page }}{{ .Summary | markdownify }}{{ end -}} -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/base-images/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What are base images?" 3 | weight=5 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-inputs/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Configure build inputs" 3 | weight=1 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="For Buildpack Authors" 3 | weight=3 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Write buildpacks" 3 | weight=1 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-extensions/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Write extensions" 3 | weight=2 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="For Platform Operators" 3 | weight=2 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Tutorials" 3 | weight=1 4 | expand=true 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-outputs/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Understand build outputs" 3 | weight=2 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/lifecycle-phases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/lifecycle-phases.png -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/special-cases/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Build in custom environments" 3 | weight=3 4 | include_summaries=true 5 | +++ 6 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Prepare build inputs" 3 | weight=2 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/buildpacks-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/buildpacks-social-card.jpg -------------------------------------------------------------------------------- /themes/buildpacks/static/images/registry-add-buildpack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/registry-add-buildpack.png -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/deprecated/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Deprecated (unsupported) APIs" 3 | weight=99 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Integrate with your favorite CI tooling" 3 | weight=1 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/deprecated/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Deprecated (unsupported) APIs" 3 | weight=99 4 | 5 | include_summaries=true 6 | +++ 7 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/buildpacks-social-card-square.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buildpacks/docs/HEAD/themes/buildpacks/static/images/buildpacks-social-card-square.jpg -------------------------------------------------------------------------------- /.vale.ini: -------------------------------------------------------------------------------- 1 | StylesPath = .github/styles 2 | 3 | MinAlertLevel = suggestion 4 | 5 | Packages = Google 6 | 7 | Vocab = Buildpacks 8 | 9 | [*] 10 | BasedOnStyles = Vale, Google 11 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/feature.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ .Get "title" }}

3 | {{- .Inner | markdownify -}} 4 |
-------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/download-button.html: -------------------------------------------------------------------------------- 1 | {{- .Inner -}}
-------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_layout.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Layout 4 | 5 | **********************************/ 6 | 7 | .heading { 8 | padding-top: .75rem; 9 | } 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Community Slack 4 | url: https://slack.cncf.io 5 | about: Chat with the community about any issues, questions, or feedback 6 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/page-replace-toggle-option.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/pack/cli/_index.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="CLI Docs" 4 | aliases=[ 5 | "/docs/tools/pack/cli/" 6 | ] 7 | include_summaries=true 8 | +++ 9 | 10 | This section describes the Pack Command Line Interface (CLI). 11 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_footline.scss: -------------------------------------------------------------------------------- 1 | .footline { 2 | font-size: 0.75rem; 3 | display: flex; 4 | justify-content: space-between; 5 | color: $gray-light; 6 | > *:not(:first-child):not(:last-child) { 7 | padding: 0 20px; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_well.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Well 4 | 5 | **********************************/ 6 | 7 | .well { 8 | background-color: $off-white; 9 | box-shadow: inset 0 1px 15px 0 rgba($gray-dark, 0.1); 10 | } 11 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/pack-version.html: -------------------------------------------------------------------------------- 1 | {{- $pack_version := (getenv $.Site.Params.pack_version_env_var) -}} 2 | {{ if not $pack_version }} 3 | {{ errorf "Unable to find 'pack_version': %s" $.Site.Params.pack_version_env_var }} 4 | {{ end }} 5 | {{- $pack_version -}} -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_grid.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Grid 4 | 5 | **********************************/ 6 | 7 | .grid { 8 | display: grid; 9 | grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); 10 | grid-gap: 1rem; 11 | } -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/pack/concepts/_index.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Concepts" 4 | aliases=[ 5 | "/docs/tools/pack/concepts/" 6 | ] 7 | include_summaries=true 8 | 9 | weight=2 10 | +++ 11 | 12 | This section describes some concepts related to the Pack CLI. 13 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_highlights.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Highlights 4 | 5 | **********************************/ 6 | 7 | .highlights { 8 | svg path { 9 | stroke: $off-gray; 10 | stroke-width: 6px; 11 | fill: $blue-dark; 12 | } 13 | } -------------------------------------------------------------------------------- /themes/buildpacks/theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/spf13/hugoThemes#themetoml for an example 3 | 4 | name = "Buildpacks Theme" 5 | license = "MIT" 6 | description = "A theme for the Buildpacks.io website" 7 | homepage = "https://buildpacks.io" 8 | min_version = 0.49 9 | -------------------------------------------------------------------------------- /.github/styles/config/vocabularies/Buildpacks/accept.txt: -------------------------------------------------------------------------------- 1 | API(?s) 2 | [Bb]uildpack(?s) 3 | config 4 | containerd 5 | Dockerfile(?s) 6 | GitHub 7 | mixin(?s) 8 | prepended 9 | rebase 10 | Rebasing 11 | SBOM(?s) 12 | semver 13 | Syft 14 | [Tt]ekton 15 | [Kk]ubernetes 16 | uid 17 | Minikube 18 | kubectl 19 | Quarkus -------------------------------------------------------------------------------- /data/calendar.yml: -------------------------------------------------------------------------------- 1 | # teamup calendar id (read-only) 2 | id: ksxw26c3km72mq3imn 3 | # teamup token 4 | token: 2144578740eb908ea5b160b649d25300e559a59522f8b528757cf6e75381ab88 5 | subcalendars: 6 | # format: 7 | # - id: teamup id 8 | # - name: human readable name 9 | # - color: html color of events on calendar 10 | - id: 9046534 11 | name: Working Group 12 | color: '#d96fbf' -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_talks.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Talks Widget 4 | 5 | **********************************/ 6 | 7 | .talks-presenter { 8 | font-size: 0.8rem; 9 | white-space:nowrap; 10 | } 11 | 12 | .talk { 13 | border-left: 6px solid transparent; 14 | 15 | &[data-active="true"] { 16 | border-left-color: $pink; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{ $name := .Get "name" }} 2 | {{ $id := $name | urlize }} 3 | {{ $active := cond (eq (.Parent.Get "active" | urlize) $id) "active show" "" }} 4 |
11 | {{ .Inner | markdownify }} 12 |
13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## OS Files 2 | # Windows 3 | Thumbs.db 4 | ehthumbs.db 5 | Desktop.ini 6 | $RECYCLE.BIN/ 7 | 8 | # OSX 9 | .DS_Store 10 | 11 | # Artifacts 12 | /public 13 | /resources 14 | 15 | # IDEs 16 | .idea/ 17 | *.iml 18 | 19 | # Generated files 20 | content/docs/for-platform-operators/how-to/integrate-ci/pack/cli/pack* 21 | 22 | # Hugo 23 | .hugo_build.lock 24 | 25 | # Tools 26 | /bin 27 | /tmp 28 | 29 | /tools/bin -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/create-builder/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Create a builder" 3 | weight=1 4 | include_summaries=true 5 | +++ 6 | 7 | A [builder][builder] is an OCI image with all the inputs needed for a buildpacks build, including 8 | the build-time base image, a reference to a runtime base image, a lifecycle, and a set of buildpacks. 9 | 10 | [builder]: /docs/for-platform-operators/concepts/builder -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/special-cases/build-for-windows.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Build for Windows containers" 4 | aliases=[ 5 | "/docs/app-developer-guide/build-a-windows-app" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | The Cloud Native Buildpacks tools have dropped support for Windows containers on Windows (WCOW). 11 | 12 | You can continue to build Linux containers on Windows using `pack` and other Cloud Native Buildpacks tools. 13 | -------------------------------------------------------------------------------- /content/docs/.common/concepts/composite-buildpack.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a composite buildpack?" 3 | weight=99 4 | +++ 5 | 6 | A composite buildpack, also sometimes called a "meta buildpack", 7 | is a buildpack that does not contain any `./bin/detect` or `./bin/build` binaries, 8 | but instead references other buildpacks in its `buildpack.toml` via the `[[order]]` array. 9 | 10 | This is useful for composing more complex detection strategies. 11 | -------------------------------------------------------------------------------- /content/docs/reference/spec/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Specification" 3 | include_summaries=true 4 | expand=true 5 | +++ 6 | 7 | The Cloud Native Buildpacks specification defines the APIs that buildpacks, platforms, and the lifecycle must implement. 8 | 9 | Most buildpack users won't need this information unless they are writing a buildpack or a platform that supports buildpacks. 10 | 11 | 12 | 13 | The specification consists of the following: 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Set update schedule for gomod 4 | - package-ecosystem: "gomod" 5 | directory: "/" 6 | schedule: 7 | # Check for updates to GitHub Actions every weekday 8 | interval: "daily" 9 | 10 | # Set update schedule for GitHub Actions 11 | - package-ecosystem: "github-actions" 12 | directory: "/" 13 | schedule: 14 | # Check for updates to GitHub Actions every weekday 15 | interval: "daily" -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | ports: 2 | - port: 1313 3 | onOpen: open-preview 4 | 5 | tasks: 6 | - name: Setup 7 | before: chmod ugo+w /var/run/docker.sock 8 | init: make build 9 | command: chmod ugo+w /var/run/docker.sock 10 | 11 | github: 12 | prebuilds: 13 | master: true 14 | branches: true 15 | pullRequests: true 16 | pullRequestsFromForks: true 17 | addCheck: true 18 | 19 | vscode: 20 | extensions: 21 | - golang.go 22 | - bierner.markdown-preview-github-styles 23 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/base-images/build.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Build image" 3 | weight=1 4 | +++ 5 | 6 | The **build image** provides the base image from which the build environment is constructed. 7 | 8 | 9 | 10 | The build environment is the containerized environment in which the [lifecycle] 11 | (and thereby [buildpacks][buildpack]) are executed. 12 | 13 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 14 | [buildpack]: /docs/for-app-developers/concepts/buildpack/ 15 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_text-note.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Text Note 4 | 5 | **********************************/ 6 | 7 | .text-note, 8 | blockquote { 9 | background-color: $off-gray; 10 | border-radius: 5px; 11 | padding: 20px; 12 | font-size: .9rem; 13 | line-height: 180%; 14 | color: $gray-dark; 15 | border-left: 5px solid $pink; 16 | 17 | h3 { 18 | color: inherit; 19 | font-size: larger; 20 | } 21 | 22 | p { 23 | margin: 0; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/_default/standalone.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 |
5 |
6 |
7 | {{ partial "support.html" . }} 8 | 9 |
10 |

{{ .Title | markdownify }}

11 |
12 | 13 | {{ .Content }} 14 | 15 | {{ partial "footline.html" . }} 16 |
17 |
18 |
19 |
20 | 21 | 22 | {{ end }} -------------------------------------------------------------------------------- /DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ##### Prerequisites 4 | 5 | * [jq](https://stedolan.github.io/jq/) 6 | * macOS: `brew install jq` 7 | * Windows: `choco install jq` 8 | * Ubuntu: `sudo apt install jq` 9 | * Make 10 | * macOS: `xcode-select --install` 11 | * Windows: `choco install make` 12 | * Ubuntu: `sudo apt install make` 13 | 14 | #### Serve 15 | 16 | Serve docs at http://localhost:1313 17 | 18 | ```bash 19 | make serve 20 | ``` 21 | 22 | #### Build 23 | 24 | ```bash 25 | make build 26 | ``` 27 | 28 | #### Clean 29 | 30 | ```bash 31 | make clean 32 | ``` -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/docs-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Docs Request 3 | about: Request addition to documentation 4 | title: '' 5 | labels: type/enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Summary 11 | 12 | 13 | ## What questions should this documentation answer? 14 | - 15 | 16 | ## Who is the target audience for this documentation? 17 | 18 | - [ ] App Developer 19 | - [ ] Buildpack Author 20 | - [ ] Operator 21 | - [ ] Other: 22 | 23 | ## Additional Information 24 | 25 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_helpers.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Helpers and Resets 4 | 5 | **********************************/ 6 | 7 | .img-center { 8 | display: block; 9 | margin: 0 auto; 10 | } 11 | 12 | img { 13 | max-width: 100%; /* responsive images */ 14 | } 15 | 16 | .text-right { 17 | text-align: right; 18 | } 19 | 20 | .inline-flex { 21 | display: inline-flex; 22 | } 23 | 24 | .opacity-0 { 25 | opacity: 0; 26 | } 27 | 28 | .opacity-50 { 29 | opacity: .5; 30 | } 31 | 32 | .opacity-100 { 33 | opacity: 1; 34 | } 35 | 36 | .pointer { 37 | cursor: pointer; 38 | } -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/page-replace-toggle.html: -------------------------------------------------------------------------------- 1 |
2 | {{- .Inner -}} 3 |
4 | 15 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_header.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Header 4 | 5 | **********************************/ 6 | 7 | header .navbar-light .navbar-nav .nav-link { 8 | white-space: nowrap; 9 | text-decoration: none; 10 | color: $blue-dark; 11 | 12 | &:hover { 13 | text-decoration: inherit; 14 | } 15 | 16 | border-bottom: 2px solid rgba($blue-light, 0.25); 17 | 18 | &.active { 19 | border-bottom-color: $blue-light; 20 | } 21 | } 22 | 23 | header .logo img { 24 | width: auto; 25 | min-width: 160px; 26 | @media (min-width: 768px) { 27 | width: 200px; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_base.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Base 4 | 5 | **********************************/ 6 | 7 | @-ms-viewport { 8 | width: device-width; 9 | } 10 | 11 | html { 12 | -webkit-box-sizing: border-box; 13 | box-sizing: border-box; 14 | -ms-overflow-style: scrollbar; 15 | } 16 | 17 | *, 18 | *::before, 19 | *::after { 20 | -webkit-box-sizing: inherit; 21 | box-sizing: inherit; 22 | } 23 | 24 | body { 25 | font-family: 'Source Sans Pro', sans-serif; 26 | color: $blue-dark; 27 | font-weight: 400; 28 | font-size: 1.1rem; 29 | line-height: 1.5; 30 | min-width: 320px; 31 | } 32 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/concepts/package.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a buildpack package?" 3 | weight=99 4 | +++ 5 | 6 | A `buildpack package` refers to the process of packaging buildpacks for distribution as OCI images or OCI-compatible `tar` files. 7 | 8 | 9 | 10 | A `buildpack package` typically encapsulates the scripts, required dependencies, and metadata needed to transform application source code into a fully operational application within a specific platform's runtime environment. 11 | 12 | For more information about packaging a buildpack, see [Package a buildpack or extension](https://buildpacks.io/docs/for-buildpack-authors/how-to/distribute-buildpacks/package-buildpack/). 13 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_content.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Content 4 | 5 | **********************************/ 6 | 7 | .content { 8 | h2 { 9 | padding-bottom: 1rem; 10 | margin-bottom: 2rem; 11 | position: relative; 12 | &:after { 13 | position: absolute; 14 | bottom: 0; 15 | left: 0; 16 | content: ''; 17 | width: 10%; 18 | height: 2px; 19 | background-color: $blue-light; 20 | } 21 | } 22 | 23 | ul { 24 | list-style-type: none; 25 | margin: 0 0 30px 0; 26 | padding: 0; 27 | 28 | li { 29 | border-left: 1px solid #D1D4E7; 30 | color: $blue-light; 31 | margin-bottom: 10px; 32 | padding-left: 20px; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_tabs.scss: -------------------------------------------------------------------------------- 1 | .tabbable { 2 | .nav-tabs:not(.nav-pills) { 3 | a.nav-link { 4 | text-decoration: none; 5 | border-width: 0 0 3px 0; 6 | border-radius: 0; 7 | 8 | &.active { 9 | background-color: transparent; 10 | border-color: $blue-light; 11 | color: $blue-dark; 12 | } 13 | } 14 | } 15 | 16 | .nav-pills { 17 | a.nav-link { 18 | text-decoration: none; 19 | border-width: 1px; 20 | 21 | &:not(.active) { 22 | border-style: dashed; 23 | border-color: #CCC; 24 | } 25 | 26 | &.active { 27 | background-color: transparent; 28 | border-color: $blue-light; 29 | color: $blue-dark; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/create-builder/extensions.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Specify an image extension in a builder" 4 | aliases=[ 5 | "/docs/extension-guide/consume-extension/in-builder" 6 | ] 7 | weight=101 8 | +++ 9 | 10 | If you are using extensions, here is how to include them in a builder. 11 | 12 | 13 | 14 | You're pretty sharp, and you know what your buildpack users will need. 15 | 16 | That's why you're going to add something similar to the following lines directly to `builder.toml`: 17 | 18 | ``` 19 | [[order-extensions]] 20 | [[order-extensions.group]] 21 | id = "foo" 22 | version = "0.0.1" 23 | 24 | [[extensions]] 25 | id = "foo" 26 | version = "0.0.1" 27 | uri = "/local/path/to/extension/foo" # can be relative or absolute 28 | ``` 29 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_code.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Code 4 | 5 | **********************************/ 6 | 7 | code { 8 | font-size: 87.5%; 9 | color: $pink; 10 | word-break: break-word; 11 | padding: 0 0.125rem; 12 | } 13 | 14 | a > code { 15 | color: inherit; 16 | } 17 | 18 | kbd { 19 | padding: 0.2rem 0.4rem; 20 | font-size: 87.5%; 21 | color: $white; 22 | background-color: $gray-dark; 23 | border-radius: 0.2rem; 24 | } 25 | 26 | kbd kbd { 27 | padding: 0; 28 | font-size: 100%; 29 | font-weight: 400; 30 | } 31 | 32 | pre { 33 | display: block; 34 | font-size: 87.5%; 35 | color: $gray-dark; 36 | } 37 | 38 | pre code { 39 | font-size: inherit; 40 | word-break: normal; 41 | color: $gray-light; 42 | padding: 0; 43 | } 44 | -------------------------------------------------------------------------------- /.github/PR_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | This PR fixes # 4 | 5 | ## Output 6 | 7 | 8 | #### Before 9 | 10 | #### After 11 | 12 | 13 | **Notes for Reviewers** 14 | 15 | 16 | **[Signed commits](https://github.com/buildpacks/.github/blob/main/CONTRIBUTING.md#sign-off-process)** 17 | - [ ] Yes, I signed my commits. 18 | 19 | 20 | 31 | -------------------------------------------------------------------------------- /.github/workflows/vale-lint.yml: -------------------------------------------------------------------------------- 1 | name: reviewdog 2 | on: [pull_request] 3 | 4 | jobs: 5 | vale: 6 | name: runner / vale 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | with: 11 | fetch-depth: 0 # Fetch all history to compare changes 12 | 13 | - name: Get changed files 14 | id: changed-files 15 | uses: tj-actions/changed-files@v41 16 | with: 17 | files: content/**/*.md # Only check markdown files in the content directory 18 | 19 | - uses: errata-ai/vale-action@v2.1.1 20 | if: steps.changed-files.outputs.any_changed == 'true' 21 | with: 22 | fail_on_error: true 23 | token: ${{secrets.GITHUB_TOKEN}} 24 | files: ${{ steps.changed-files.outputs.all_changed_files }} -------------------------------------------------------------------------------- /content/docs/reference/spec/distribution-api.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Distribution API" 3 | aliases=[ 4 | "/docs/reference/distribution-api/" 5 | ] 6 | +++ 7 | 8 | This specification defines the artifact format, delivery mechanism, and order resolution process for buildpacks. 9 | 10 | 11 | 12 | ## Buildpack Descriptor 13 | 14 | A buildpack must contain a `buildpack.toml` file in its root directory. 15 | 16 | ## Buildpackage 17 | 18 | A buildpackage is a distributable artifact that contains a buildpack. Its format may be either: 19 | 20 | * An OCI image 21 | * An uncompressed tar archive with the extension `.cnb` containing an OCI image. 22 | 23 | ## Further Reading 24 | 25 | You can read the complete [Distribution specification on Github](https://github.com/buildpacks/spec/blob/main/distribution.md). 26 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/github-mark.svg: -------------------------------------------------------------------------------- 1 | Asset 2 -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_table.scss: -------------------------------------------------------------------------------- 1 | table { 2 | border-collapse: initial; 3 | border-spacing: 0.5rem; 4 | 5 | &.bs-0 { 6 | border-spacing: 0; 7 | } 8 | 9 | code { 10 | padding: 0; 11 | } 12 | 13 | thead { 14 | th { 15 | border-bottom: 2px solid $pink; 16 | padding: 0.25rem 0.5rem; 17 | } 18 | } 19 | 20 | tbody { 21 | th { 22 | text-align: right; 23 | } 24 | } 25 | 26 | &.fixed { 27 | table-layout: fixed; 28 | } 29 | 30 | tr { 31 | &.border-top { 32 | th, td { 33 | border-top: 2px solid $off-gray; 34 | } 35 | } 36 | 37 | &.border-bottom { 38 | th, td { 39 | border-bottom: 2px solid $off-gray; 40 | } 41 | } 42 | } 43 | } 44 | 45 | 46 | td { 47 | padding: 0.25rem 0.5rem; 48 | } -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/rebase.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Rebase" 3 | weight=8 4 | +++ 5 | 6 | The `rebaser` places application layers atop a new version of the `runtime` base image. 7 | 8 | 9 | 10 | ### Exit Codes 11 | 12 | | Exit Code | Result | 13 | |-----------------|-------------------------------------| 14 | | `0` | Success | 15 | | `11` | Platform API incompatibility error | 16 | | `12` | Buildpack API incompatibility error | 17 | | `1-10`, `13-19` | Generic lifecycle errors | 18 | | `70-79` | Rebase-specific lifecycle errors | 19 | 20 | *** 21 | 22 | For more information about the `rebaser`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#rebaser). 23 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/site.scss: -------------------------------------------------------------------------------- 1 | @import 'reboot'; 2 | @import 'colors'; 3 | @import 'base'; 4 | @import 'layout'; 5 | @import 'typography'; 6 | @import 'code'; 7 | @import 'syntax'; 8 | 9 | @import 'components/header'; 10 | @import 'components/hero'; 11 | @import 'components/grid'; 12 | @import 'components/well'; 13 | @import 'components/content'; 14 | @import 'components/text-note'; 15 | @import 'components/table'; 16 | @import 'components/button'; 17 | @import 'components/code'; 18 | @import 'components/footer'; 19 | @import 'components/sidebar'; 20 | @import 'components/docs'; 21 | @import 'components/footline'; 22 | @import 'components/highlights'; 23 | @import "components/quote"; 24 | @import "components/tabs"; 25 | @import "components/talks"; 26 | @import 'components/lists'; 27 | @import 'components/calendar'; 28 | 29 | @import 'helpers'; -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_code.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Code 4 | 5 | **********************************/ 6 | 7 | .pre-scrollable { 8 | max-height: 340px; 9 | overflow-y: scroll; 10 | } 11 | 12 | /* one line code */ 13 | code.highlight { 14 | background-color: $off-gray; 15 | padding: 5px 10px; 16 | font-family: monospace; 17 | font-size: 1rem; 18 | color: inherit; 19 | box-shadow: 0 1px 0 0 rgba($gray-light, 0.4); 20 | border-radius: 3px; 21 | } 22 | 23 | /* multi-line code */ 24 | .code-block { 25 | background-color: white; 26 | border: 1px solid rgba($gray-light, 0.25); 27 | border-radius: .25rem; 28 | padding: 15px 20px; 29 | } 30 | 31 | /* command line code (inludes an not-selectable $ at the beginning) */ 32 | .command-line::before { 33 | content: '$'; 34 | color: rgba($gray-light, 0.5); 35 | margin-right: 15px; 36 | } 37 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/launch.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Launch" 3 | weight=7 4 | +++ 5 | 6 | The `launcher` is the entrypoint for the final OCI image, responsible for launching application processes. 7 | 8 | 9 | 10 | ### Exit Codes 11 | 12 | If the `launcher` errors before executing the process, it will have one of the following error codes: 13 | 14 | | Exit Code | Result | 15 | |-----------|-------------------------------------| 16 | | `11` | Platform API incompatibility error | 17 | | `12` | Buildpack API incompatibility error | 18 | | `80-89` | Launch-specific lifecycle errors | 19 | 20 | Otherwise, the exit code shall be the exit code of the launched process. 21 | 22 | *** 23 | 24 | For more information about the `launcher`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#launcher). 25 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_quote.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Quote 4 | 5 | **********************************/ 6 | 7 | .quote { 8 | position: relative; 9 | padding: 20px 86px; 10 | color: rgba($gray-dark, .75); 11 | font-style: italic; 12 | font-size: 1.1rem; 13 | font-weight: bold; 14 | text-align: center; 15 | line-height: 180%; 16 | border-radius: 5px; 17 | background-color: $off-gray; 18 | 19 | &:before { 20 | content: "\""; 21 | font-size: 4rem; 22 | font-family: "Fira Mono", serif; 23 | position: absolute; 24 | top: 10px; 25 | left: -20px; 26 | color: $blue-light; 27 | } 28 | 29 | .author { 30 | font-size: 1rem; 31 | font-style: initial; 32 | padding: 0 40px 0 0; 33 | text-align: right; 34 | 35 | &:before { 36 | content: "- "; 37 | color: $gray-light; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_colors.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Colors 4 | 5 | **********************************/ 6 | 7 | /* Primary colors */ 8 | $pink: #DF0A6B; 9 | $blue-dark: #242960; 10 | $blue-light: #47529E; 11 | 12 | /* Shades */ 13 | $white: #FFFFFF; 14 | $off-white: #F8F9FA; 15 | $off-gray: #EFEFEF; 16 | $off-blue: #f4f5fd; 17 | $gray-light: #7C6E75; 18 | $gray-dark: #302C2E; 19 | $black: #000000; 20 | $green: #1bb9a5; 21 | 22 | .text-pink { 23 | color: $pink; 24 | } 25 | 26 | .bg-pink { 27 | background-color: $pink; 28 | } 29 | 30 | .text-blue { 31 | color: $blue-light; 32 | } 33 | 34 | .bg-blue { 35 | background-color: $blue-light; 36 | } 37 | 38 | .bg-off-blue { 39 | background-color: $off-blue; 40 | } 41 | 42 | .bg-white { 43 | background-color: $white; 44 | } 45 | 46 | .bg-transparent { 47 | background-color: transparent; 48 | } 49 | 50 | .bg-green { 51 | background-color: $green; 52 | } -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-inputs/specify-default-launch-process.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Specify the default launch process" 3 | weight=99 4 | summary="Buildpacks can define multiple processes for an application image. Specify which process should be the default." 5 | +++ 6 | 7 | While buildpacks usually define the default process type for an application, end users may specify the desired default process. 8 | 9 | To specify the default process: 10 | 11 | * You first need to know what named process types might be contributed by the buildpacks in your build; for more information, see docs for [running the application][Run the application] 12 | * Append the following flag to the `pack build` command: 13 | 14 | ```bash 15 | pack build --default-process ` # must be a valid process name 16 | ``` 17 | 18 | [Run the application]: https://buildpacks.io/docs/for-app-developers/how-to/build-outputs/specify-launch-process/ 19 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/build.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Build" 3 | weight=4 4 | +++ 5 | 6 | The `builder` transforms application source code into runnable artifacts that can be packaged into a container. 7 | 8 | 9 | 10 | The `platform` must execute `builder` in the `build` environment. 11 | 12 | ### Exit Codes 13 | 14 | | Exit Code | Result | 15 | |-----------------|-------------------------------------| 16 | | `0` | Success | 17 | | `11` | Platform API incompatibility error | 18 | | `12` | Buildpack API incompatibility error | 19 | | `1-10`, `13-19` | Generic lifecycle errors | 20 | | `51` | Buildpack build error | 21 | | `50`, `52-59` | Build-specific lifecycle errors | 22 | 23 | *** 24 | 25 | For more information about the `builder`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#builder). 26 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/support.html: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_calendar.scss: -------------------------------------------------------------------------------- 1 | // NOTE: most changes should be done via JavaScript 2 | .calendar { 3 | .fc-header-toolbar > .fc-toolbar-chunk { 4 | align-self: flex-end !important; 5 | 6 | > .fc-toolbar-title { 7 | font-size: 1.25rem; 8 | margin-bottom: 0; 9 | padding-bottom: 0; 10 | } 11 | } 12 | 13 | @media(max-width: 767px) { 14 | .fc-toolbar.fc-header-toolbar { 15 | .fc-dayGridWeek-button,.fc-dayGridMonth-button { 16 | display: none; 17 | } 18 | } 19 | } 20 | 21 | @media(max-width: 576px) { 22 | .fc-toolbar.fc-header-toolbar { 23 | display: flex; 24 | flex-direction: column; 25 | } 26 | 27 | .fc-toolbar.fc-header-toolbar .fc-left { 28 | order: 3; 29 | } 30 | 31 | .fc-toolbar.fc-header-toolbar .fc-center { 32 | order: 1; 33 | } 34 | 35 | .fc-toolbar.fc-header-toolbar .fc-right { 36 | order: 2; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/tabs.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 18 | 19 | 20 |
21 | {{ .Inner | markdownify }} 22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/builder.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a builder?" 3 | weight=2 4 | aliases=[ 5 | "/docs/using-pack/working-with-builders/" 6 | ] 7 | +++ 8 | 9 | A `builder` is an OCI image containing 10 | an ordered combination of [buildpacks][buildpack] and 11 | a build-time base image, a [lifecycle] binary, and a reference to a runtime base image. 12 | 13 | 14 | 15 | ![create-builder diagram](/images/create-builder.svg) 16 | 17 | ## Anatomy of a builder 18 | 19 | A builder consists of the following components: 20 | 21 | * [Buildpacks][buildpack] 22 | * A [lifecycle][lifecycle] 23 | * A [build image][build-image] 24 | * A reference to a [run image][run-image] 25 | 26 | ### Resources 27 | 28 | To learn how to create your own builder, see our [Operator's Guide][operator-guide]. 29 | 30 | [buildpack]: /docs/for-platform-operators/concepts/buildpack/ 31 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 32 | [operator-guide]: /docs/for-platform-operators/ 33 | [build-image]: /docs/for-platform-operators/concepts/base-images 34 | [run-image]: /docs/for-platform-operators/concepts/base-images 35 | -------------------------------------------------------------------------------- /content/docs/reference/spec/platform-api.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Platform API" 3 | aliases=[ 4 | "/docs/reference/platform-api/" 5 | ] 6 | +++ 7 | 8 | The Platform specification defines the interface between the CNB [lifecycle](/docs/for-platform-operators/concepts/lifecycle/) and a [platform](/docs/for-app-developers/concepts/platform/) that runs it. 9 | 10 | 11 | 12 | ## Buildpacks 13 | 14 | Buildpacks are stored on the filesystem as unarchived files such that: 15 | 16 | * Each top-level directory is a buildpack ID. 17 | * Each second-level directory is a buildpack version. 18 | 19 | ## Users 20 | 21 | For security reasons, images built with platforms, such as `pack`, build and run as non-root users. 22 | 23 | ## Stacks (deprecated) 24 | 25 | A stack (deprecated) is the grouping together of the build and run base images, represented by a unique ID. 26 | 27 | The build image is used to run the buildpack lifecycle, and the run image is the base image for the application image. 28 | 29 | ## Further Reading 30 | 31 | You can read the complete [Platform API specification on Github](https://github.com/buildpacks/spec/blob/main/platform.md). 32 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/build.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What happens during build?" 3 | weight=3 4 | +++ 5 | 6 | `Build` is the process of executing one or more [buildpacks][buildpack] against an application's source code to produce a runnable OCI image. 7 | 8 | 9 | 10 | ## Building explained 11 | 12 | ![build diagram](/images/build.svg) 13 | 14 | Each [buildpack] inspects the source code and provides relevant dependencies. 15 | An image is then generated from the app's source code and these dependencies. 16 | 17 | During the build process, the [build-time base image] becomes the environment in which buildpacks are executed, 18 | and the [runtime base image] becomes the base for the final app image. 19 | 20 | [Buildpacks][buildpack] can be bundled together with a specific [build-time base image], resulting in a [builder] image. 21 | Builders provide a convenient way to distribute buildpacks. 22 | 23 | [build-time base image]: /docs/for-app-developers/concepts/base-images/build/ 24 | [builder]: /docs/for-platform-operators/concepts/builder 25 | [buildpack]: /docs/for-app-developers/concepts/buildpack/ 26 | [runtime base image]: /docs/for-app-developers/concepts/base-images/run/ 27 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/_typography.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Typography 4 | 5 | **********************************/ 6 | 7 | h1, .h1, 8 | h2, .h2, 9 | h3, .h3, 10 | h4, .h4, 11 | h5, .h5 12 | h6, .h6 { 13 | line-height: 1.2; 14 | } 15 | 16 | h2, .h2, 17 | h3, .h3, 18 | h4, .h4, 19 | h5, .h5, 20 | h6, .h6 { 21 | font-weight: 600; 22 | padding-bottom: .5rem; 23 | } 24 | 25 | h1, .h1 { 26 | font-size: 1.8rem; 27 | } 28 | 29 | h2, .h2 { 30 | font-size: 1.6rem; 31 | } 32 | 33 | h3, .h3 { 34 | font-size: 1.2rem; 35 | } 36 | 37 | h4, .h4, 38 | h5, .h5, 39 | h6, .h6 { 40 | font-size: 1.2rem; 41 | padding-bottom: .25rem; 42 | } 43 | 44 | @media (min-width: 768px) { 45 | h1, .h1 { 46 | font-size: 2.5rem; 47 | } 48 | 49 | h2, .h2 { 50 | font-size: 1.8rem; 51 | } 52 | 53 | h3, .h3 { 54 | font-size: 1.4rem; 55 | } 56 | } 57 | 58 | a { 59 | text-decoration: underline; 60 | color: inherit; 61 | transition: opacity 0.1s; 62 | } 63 | 64 | a:hover { 65 | opacity: .7; 66 | color: inherit; 67 | } 68 | 69 | b, strong { 70 | font-weight: 600; 71 | } 72 | 73 | hr { 74 | border: 0; 75 | height: 1px; 76 | background: $off-gray; 77 | } 78 | -------------------------------------------------------------------------------- /.github/bug_report.md: -------------------------------------------------------------------------------- 1 | ### **Describe the bug** 2 | A clear and concise description of what the bug is. 3 | 4 | ### **To Reproduce** 5 | Steps to reproduce the behavior: 6 | 1. Go to '...' 7 | 2. Click on '....' 8 | 3. Scroll down to '....' 9 | 4. See error 10 | 11 | ### **Expected behavior** 12 | A clear and concise description of what you expected to happen. 13 | 14 | ### **Screenshots** 15 | If applicable, add screenshots or screen captures to help explain your problem. 16 | 17 | ### **Additional context** 18 | Add any other context about the problem here. 19 | 20 |
21 | 22 | 23 | **Note:** 24 | * If you want to work on an issue, you should check if it has already been assigned to anyone. **If the issue is free** and you would like to be assigned to it please comment on the issue. 25 | * If you are raising a new issue and want to work on it then also you should comment to get assigned. 26 | * Please **refrain from** adding labels to your issue/pull-request on your own. It is the job of the Project Admin and the Mentors to review your issue/pull-request and add labels accordingly. 27 | 28 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/basic-buildpack/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Write a basic buildpack" 3 | weight=1 4 | +++ 5 | 6 | This is a step-by-step tutorial for creating a nodeJS Cloud Native Buildpack. 7 | 8 | 9 | 10 | ## What we'll cover 11 | 12 | - [Setting up your local environment](/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment) 13 | - [The building blocks of a Cloud Native Buildpack](/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb) 14 | - [Detecting your application](/docs/for-buildpack-authors/tutorials/basic-buildpack/03_detection) 15 | - [Building your application](/docs/for-buildpack-authors/tutorials/basic-buildpack/04_build-app) 16 | - [Making your application runnable](/docs/for-buildpack-authors/tutorials/basic-buildpack/05_make-app-runnable) 17 | - [Improving performance with caching](/docs/for-buildpack-authors/tutorials/basic-buildpack/06_caching) 18 | - [Making your buildpack configurable](/docs/for-buildpack-authors/tutorials/basic-buildpack/07_make-buildpack-configurable) 19 | 20 |
21 | 22 | 23 | Start Tutorial 24 | 25 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/gitlab.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Gitlab Auto DevOps" 4 | aliases=[ 5 | "/docs/tools/gitlab" 6 | ] 7 | weight=4 8 | +++ 9 | 10 | [Gitlab][about-gitlab] is a web-based DevOps platform. The [Auto DevOps][devops] feature uses [`pack`][pack] 11 | to build applications prior to deploying them. 12 | 13 | 14 | 15 | ## Use 16 | To use the CNB integration, you need to configure the Auto DevOps feature, as discussed in [the DevOps guide][devops-guide]. At that point, 17 | you can opt in to using Cloud Native Buildpacks by following the steps in their [CNB documentation][use-cnbs]. 18 | 19 | This may look like the following in your `.gitlab-ci.yml` file: 20 | ```yaml 21 | include: 22 | - template: Auto-DevOps.gitlab-ci.yml 23 | 24 | variables: 25 | AUTO_DEVOPS_BUILD_IMAGE_CNB_ENABLED: "true" 26 | ``` 27 | 28 | ### References 29 | 30 | - [Auto Build with CNB Docs][use-cnbs] 31 | 32 | [pack]: /docs/install-pack 33 | [about-gitlab]: https://about.gitlab.com/ 34 | [devops]: https://docs.gitlab.com/ee/topics/autodevops/ 35 | [devops-guide]: https://docs.gitlab.com/ee/topics/autodevops/#get-started-with-auto-devops 36 | [use-cnbs]: https://docs.gitlab.com/ee/topics/autodevops/stages.html#auto-build-using-cloud-native-buildpacks 37 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 6 |
7 | 20 | 25 |
26 |
27 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/circleci.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="CircleCI" 4 | aliases=[ 5 | "/docs/tools/circleci" 6 | ] 7 | weight=3 8 | +++ 9 | 10 | [CircleCI][circleci] is a continuous integration and delivery platform. 11 | 12 | The CNB project maintains an integration, called an [orb](https://circleci.com/orbs/), 13 | which allows users to run [pack][pack] commands inside their pipelines. 14 | 15 | 16 | 17 | ## Use 18 | To use the CNB integration, you need to declare that you are using the [`buildpacks/pack` orb](https://circleci.com/developer/orbs/orb/buildpacks/pack), and then use 19 | it in your workflow. 20 | 21 | For instance, your `.circleci/config.yml` file may look like this: 22 | ```yaml 23 | version: 2.1 24 | orbs: 25 | pack: buildpacks/pack@0.2.0 26 | workflows: 27 | main: 28 | jobs: 29 | - pack/build: 30 | image-name: sample 31 | builder: 'paketobuildpacks/builder:base' 32 | ``` 33 | 34 | For more precise steps, see the `pack-orb` [documentation][pack-orb-docs] 35 | 36 | ## References 37 | 38 | - [Source Code][pack-orb-source] 39 | - [Pack Orb Documentation][pack-orb-docs] 40 | 41 | [pack]: /docs/install-pack 42 | [circleci]: https://circleci.com/ 43 | [pack-orb-source]: https://github.com/buildpacks/pack-orb 44 | [pack-orb-docs]: https://circleci.com/developer/orbs/orb/buildpacks/pack 45 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/basic-extension/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Write a basic extension" 3 | weight=2 4 | aliases = [ 5 | "/docs/extension-author-guide/create-extension" 6 | ] 7 | +++ 8 | 9 | This is a step-by-step tutorial for creating and using image extensions, which allow for customization of the build-time and runtime base images using Dockerfiles. 10 | 11 | 12 | 13 | ## What we'll cover 14 | 15 | - [Setting up your local environment](/docs/for-buildpack-authors/tutorials/basic-extension/01_setup-local-environment) 16 | - [Why this feature?](/docs/for-buildpack-authors/tutorials/basic-extension/02_why-dockerfiles) 17 | - [The building blocks of a Cloud Native Buildpacks image extension](/docs/for-buildpack-authors/tutorials/basic-extension/03_building-blocks-extension) 18 | - [Extending the build-time base image with a build.Dockerfile](/docs/for-buildpack-authors/tutorials/basic-extension/04_build-dockerfile) 19 | - [Switching the runtime base image with a run.Dockerfile](/docs/for-buildpack-authors/tutorials/basic-extension/05_run-dockerfile-switch) 20 | - [Extending the runtime base image with a run.Dockerfile](/docs/for-buildpack-authors/tutorials/basic-extension/06_run-dockerfile-extend) 21 | 22 |
23 | 24 | 25 | Start Tutorial 26 | 27 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/download-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_sidebar.scss: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | font-size: 1rem; 3 | padding: 10px 0 0 0; 4 | position: -webkit-sticky; 5 | position: sticky; 6 | top: 0; 7 | 8 | ul { 9 | list-style: none; 10 | padding: 0; 11 | margin: 0; 12 | } 13 | 14 | a { 15 | text-decoration: none; 16 | color: $gray-light; 17 | display: inline-block; 18 | transition: opacity 0.2s; 19 | } 20 | 21 | .depth-0 { 22 | > a { 23 | display: block; 24 | padding: 0 20px 10px 20px; 25 | font-weight: 600; 26 | position: relative; 27 | 28 | &:before { 29 | position: absolute; 30 | content: "•"; 31 | left: 6px; 32 | opacity: 0.30; 33 | } 34 | } 35 | 36 | padding: 10px 0; 37 | border-bottom: 1px solid rgba($gray-light, 0.10); 38 | } 39 | 40 | li.parent { 41 | background: rgba($white, 0.5); 42 | } 43 | 44 | li[class*="depth-"]:not(.depth-0) { 45 | margin-left: 15px; 46 | 47 | a { 48 | padding: .25rem 1rem; 49 | } 50 | 51 | &.parent { 52 | background: 0 .75rem url("/images/list-item.svg") no-repeat; 53 | 54 | > a { 55 | color: $blue-dark; 56 | } 57 | } 58 | 59 | &.active { 60 | background: 0 .75rem url("/images/list-item-active.svg") no-repeat; 61 | 62 | > a { 63 | color: $pink; 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /content/docs/reference/spec/buildpack-api.md: -------------------------------------------------------------------------------- 1 | +++ title="Buildpack API" 2 | aliases=[ 3 | "/docs/reference/buildpack-api/" 4 | ] 5 | +++ 6 | 7 | The Buildpack API specifies the interface between a [lifecycle] program and one or more [buildpacks][buildpack]. 8 | 9 | 10 | 11 | ## API Compatibility 12 | 13 | A [buildpack] only ever implements one Buildpack API version at a time. 14 | The implemented Buildpack API version can be found in the `buildpack.toml` file in the buildpack's root directory, 15 | or in a label on a buildpack package. 16 | 17 | A [lifecycle] may (and usually does) support more than one Buildpack API version at a time. 18 | The supported Buildpack API version(s) can be found in the `lifecycle.toml` file in a lifecycle tarball, 19 | or in a label on the [lifecycle image](https://hub.docker.com/r/buildpacksio/lifecycle). 20 | 21 | A lifecycle "supports" a buildpack if they both declare support for the same Buildpack API version in format: `.`. 22 | 23 | Two buildpacks of different Buildpack API versions can participate in the same build, 24 | provided they are both supported by the lifecycle. 25 | 26 | ## Further Reading 27 | 28 | You can read the complete [Buildpack API specification on Github](https://github.com/buildpacks/spec/blob/main/buildpack.md). 29 | 30 | [buildpack]: /docs/for-platform-operators/concepts/buildpack/ 31 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 32 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/rebase.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="What happens during rebase?" 4 | aliases=[ 5 | "/docs/concepts/operations/rebase", 6 | "/docs/using-pack/update-app-rebase/" 7 | ] 8 | weight=4 9 | +++ 10 | 11 | `Rebase` allows app developers or operators to rapidly update an app image when its [runtime base image] has changed. 12 | 13 | 14 | 15 | ### Rebasing explained 16 | 17 | By using image layer rebasing, this command avoids the need to fully rebuild the app. 18 | 19 | ![rebase diagram](/images/rebase.svg) 20 | 21 | At its core, image rebasing is a simple process. By inspecting an app image, `rebase` can determine whether or not a 22 | newer version of the app's base image exists (either locally or in a registry). 23 | If so, `rebase` updates the app image's layer metadata to reference the newer base image version. 24 | 25 | ### Example: Rebasing an app image 26 | 27 | Consider an app image `my-app:my-tag` that was originally built using the default builder. 28 | That builder has a reference to a run image called `pack/run`. 29 | Running the following will update the base of `my-app:my-tag` with the latest version of `pack/run`. 30 | 31 | ```bash 32 | $ pack rebase my-app:my-tag 33 | ``` 34 | 35 | > **TIP:** `pack rebase` has a `--publish` flag that can be used to publish the updated app image directly to a registry. 36 | > Using `--publish` is optimal when using a registry in comparison to the docker daemon. 37 | 38 | [runtime base image]: /docs/for-app-developers/concepts/base-images/run/ 39 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-inputs/specify-export-target.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Specify export target" 3 | weight=50 4 | +++ 5 | 6 | Tell `pack` where you want your application image to be saved. 7 | 8 | 9 | 10 | By default, when you build an application with `pack build `, the image will be saved to a daemon, such as Docker or [Podman][podman], 11 | and you can view the image using a command such as `docker image ls`. 12 | 13 | However, you could also choose to "publish" the application to an OCI registry, such as Docker Hub or Google Artifact Registry, 14 | or even to a local registry, by providing the `pack build --publish` flag. 15 | 16 | Or, you could save the image in OCI layout format on disk by prefixing your image name with `oci:`, as in `pack build oci:`. 17 | See [here][OCI layout] for more information about working with layout images. 18 | 19 | ## FAQ: What am I using the daemon for? 20 | 21 | Buildpacks always need to run in a containerized environment. 22 | Therefore, even when you publish the application image to a registry, 23 | `pack` is still using a daemon under the hood to create the build container(s) where buildpacks run. 24 | 25 | The relationship between the build container and the application container can be seen in the diagram below: 26 | 27 | ![build diagram](/images/build-container-app-container.svg) 28 | 29 | [podman]: /docs/for-app-developers/how-to/special-cases/build-on-podman 30 | [OCI layout]: /docs/for-app-developers/how-to/special-cases/export-to-oci-layout 31 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/concepts/targets.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What are targets?" 3 | aliases=[ 4 | "/docs/concepts/components/targets" 5 | ] 6 | weight=3 7 | +++ 8 | 9 | The concept of `targets` is used to identify compatibility between buildpacks and base images. 10 | 11 | 12 | 13 | Target data includes: 14 | 15 | * Operating system name (e.g., "linux") 16 | * Architecture (e.g., "amd64", "arm64") 17 | * Architecture variant 18 | * Operating system distribution name (e.g., "ubuntu", "alpine") 19 | * Operating system distribution version (e.g., "22.04", "3.18.3") 20 | 21 | For Linux-based images, operating system distribution name and version should be the values in `/etc/os-release` (`$ID` and `$VERSION_ID`). 22 | For Windows-based images, operating system distribution name is blank, and version should be the value of `os.version` in the image config (e.g., `10.0.14393.1066`). 23 | 24 | Buildpacks may declare the targets they are compatible with in `buildpack.toml`. 25 | This information will be used by `pack` (or other platforms) and the lifecycle to avoid running buildpacks on images they aren't designed to work with. 26 | 27 | Additionally, during builds this information will be read by the lifecycle from the run image and exposed to buildpacks through `CNB_TARGET_` environment variables: 28 | 29 | * `CNB_TARGET_OS` 30 | * `CNB_TARGET_ARCH` 31 | * `CNB_TARGET_ARCH_VARIANT` 32 | * `CNB_TARGET_DISTRO_NAME` 33 | * `CNB_TARGET_DISTRO_VERSION` 34 | 35 | Buildpacks can use this information to modify their behavior depending on the target. 36 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_footer.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Footer 4 | 5 | **********************************/ 6 | 7 | .footer { 8 | display: flex; 9 | flex-direction: column; 10 | justify-content: space-between; 11 | align-items: center; 12 | padding-top: 30px; 13 | padding-bottom: 30px; 14 | text-align: center; 15 | font-size: 1rem; 16 | } 17 | 18 | .footer img { 19 | max-width: 300px; 20 | width: 100%; 21 | } 22 | 23 | .footer p { 24 | margin: 10px 0 0; 25 | } 26 | 27 | @media (min-width: 768px) { 28 | .footer { 29 | flex-direction: row; 30 | padding-top: 50px; 31 | padding-bottom: 50px; 32 | text-align: left; 33 | } 34 | 35 | .footer p { 36 | margin: 0; 37 | } 38 | } 39 | 40 | .sub-footer { 41 | color: white; 42 | display: flex; 43 | flex-direction: column; 44 | justify-content: space-between; 45 | align-items: center; 46 | text-align: center; 47 | padding-top: 20px; 48 | padding-bottom: 20px; 49 | font-size: .9rem; 50 | font-weight: 400; 51 | } 52 | 53 | .sub-footer p { 54 | margin: 0; 55 | } 56 | 57 | .sub-footer ul { 58 | list-style-type: none; 59 | margin: 0; 60 | padding: 0; 61 | display: flex; 62 | } 63 | 64 | .sub-footer li { 65 | margin: 10px 0; 66 | } 67 | 68 | /* the bullets between lis */ 69 | .sub-footer span { 70 | margin: 0 10px; 71 | } 72 | 73 | @media (min-width: 768px) { 74 | .sub-footer { 75 | flex-direction: row; 76 | text-align: left; 77 | } 78 | 79 | .sub-footer li { 80 | margin: 0; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/piper.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title='Project "Piper"' 4 | aliases=[ 5 | "/docs/tools/piper" 6 | ] 7 | weight=5 8 | +++ 9 | 10 | [Project "Piper"][piper] is a set of ready-made continuous delivery pipelines for direct use in your project. 11 | It now also implements the CNB Platform spec as a step and makes it available in your Jenkins pipeline. 12 | 13 | [Project "Piper"][piper] is maintained by [SAP][sap]. 14 | 15 | 16 | 17 | ## Use 18 | 19 | The step called [cnbBuild][cnbbuild] allows you to integrate Cloud Native Buildpacks (CNB) into your Jenkins pipeline. 20 | 21 | ```groovy 22 | @Library(["piper-os"]) _ 23 | 24 | node() { 25 | stage("Init") { 26 | git branch: "main", url: "https://github.com/spring-projects/spring-petclinic" 27 | setupCommonPipelineEnvironment(script: this) 28 | } 29 | 30 | stage("Build") { 31 | cnbBuild( 32 | script: this, 33 | dockerConfigJsonCredentialsId: 'DOCKER_REGISTRY_CREDS', 34 | containerImageName: 'image-name', 35 | containerImageTag: 'v0.0.1', 36 | containerRegistryUrl: 'gcr.io' 37 | ) 38 | } 39 | } 40 | ``` 41 | 42 | ### References 43 | 44 | - [Project Piper][piper] 45 | - [cnbBuild step][cnbbuild] 46 | - [SAP Piper Blogpost][blogpost] 47 | 48 | [sap]: https://www.sap.com/ 49 | [piper]: https://www.project-piper.io/ 50 | [cnbbuild]: https://www.project-piper.io/steps/cnbBuild/ 51 | [blogpost]: https://medium.com/buildpacks/support-for-cloud-native-buildpacks-in-jenkins-656330156e77 52 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/list-item-active.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/deprecated/platform-api-0.6-0.7.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Platform API 0.6 -> 0.7" 4 | aliases=[ 5 | "/docs/reference/spec/migration/platform-api-0.6-0.7" 6 | ] 7 | weight=4 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to platform operators. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.7) for Platform API 0.7 for the full list of changes and further details. 15 | 16 | ## Platform Operator 17 | 18 | ### Run the analyzer before the detector 19 | 20 | The order of the lifecycle phases has been changed starting from Platform API 0.7.\ 21 | The order before Platform API 0.7 was: detect, analyze, restore, build, and export.\ 22 | The order starting from Platform API 0.7 is: analyze, detect, restore, build, and export.\ 23 | The main reason for this change was to validate registry access for all images that are used during the build as early as possible. Starting from `Platform API 0.7`, it happens in the first lifecycle phase, as part of the `analyzer`, before running the `detector`. In this way it provides faster failures for end users. 24 | 25 | As part of this change, a few flags were removed and others were added to some of the lifecycle phases. 26 | 27 | The flags that were removed from the analyzer are: 28 | * `-cache-dir` 29 | * `-group` 30 | * `-skip-layers` 31 | 32 | The flags that were added to the analyzer are: 33 | * `-previous-image` 34 | * `-run-image` 35 | * `-stack` 36 | * `-tag` 37 | 38 | The flags that were added to the restorer are: 39 | * `-analyzed` 40 | * `-skip-layers` 41 | 42 | The flag that was removed from the exporter is: 43 | * `-run-image` 44 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/create.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Create" 3 | weight=6 4 | +++ 5 | 6 | The `creator` runs `analyze`, `detect`, `restore`, `build`, and `export` in a single command. 7 | 8 | 9 | 10 | The `platform` must execute `creator` in the `build` environment. 11 | An image reference (i.e., ``) to be analyzed is one of the `creator`'s inputs. 12 | 13 | - **If** `` is `true` the `creator` shall skip the restoration of any data to each buildpack's layers directory, with the exception of `store.toml`. 14 | - **If** the platform provides one or more `` inputs they shall be treated as additional `` inputs to the `exporter` 15 | 16 | ### Exit Codes 17 | 18 | The outputs produced by `creator` are identical to those produced by `exporter`, with the following additional expanded set of error codes. 19 | 20 | | Exit Code | Result | 21 | |-----------------|---------------------------------------| 22 | | `0` | Success | 23 | | `11` | Platform API incompatibility error | 24 | | `12` | Buildpack API incompatibility error | 25 | | `1-10`, `13-19` | Generic lifecycle errors | 26 | | `20-29` | Detection-specific lifecycle errors | 27 | | `30-39` | Analysis-specific lifecycle errors | 28 | | `40-49` | Restoration-specific lifecycle errors | 29 | | `50-59` | Build-specific lifecycle errors | 30 | | `60-69` | Export-specific lifecycle errors | 31 | 32 | *** 33 | 34 | For more information about the `creator`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#creator). 35 | -------------------------------------------------------------------------------- /content/features.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Features" 3 | weight=1 4 | layout="standalone" 5 | summary="Cloud Native Buildpacks provide a unique solution to the image build process. See how it compares to the alternatives." 6 | +++ 7 | 8 |
9 | 10 | {{< feature title="Advanced Caching" align="right" >}} 11 | Robust caching is used to improve performance. 12 | {{}} 13 | 14 | {{< feature title="Auto-detection" align="right" >}} 15 | Images can be built directly from application source without additional instructions. 16 | {{}} 17 | 18 | {{< feature title="Bill-of-Materials" >}} 19 | Insights into the contents of the app image through standard build-time SBOMs in CycloneDX, SPDX and Syft JSON formats. 20 | {{}} 21 | 22 | {{< feature title="Modular / Pluggable" >}} 23 | Multiple buildpacks can be used to create an app image. 24 | {{}} 25 | 26 | {{< feature title="Multi-language" >}} 27 | Supports more than one programming language family. 28 | {{}} 29 | 30 | {{< feature title="Multi-process" >}} 31 | Image can have multiple entrypoints for each operational mode. 32 | {{}} 33 | 34 | {{< feature title="Minimal app image" >}} 35 | Image contains only what is necessary. 36 | {{}} 37 | 38 | {{< feature title="Rebasing" >}} 39 | Instant updates of base images without re-building. 40 | {{}} 41 | 42 | {{< feature title="Reproducibility" >}} 43 | Reproduces the same app image digest by re-running the build. 44 | {{}} 45 | 46 | {{< feature title="Reusability" >}} 47 | Leverage production-ready buildpacks maintained by the community. 48 | {{}} 49 | 50 |
51 | 52 | ## Comparison 53 | 54 | {{< comparison-table >}} -------------------------------------------------------------------------------- /themes/buildpacks/static/images/slack-mark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/kpack.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="kpack" 4 | aliases=[ 5 | "/docs/tools/kpack" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | [kpack][kpack] is a Kubernetes-native platform that uses unprivileged Kubernetes primitives to perform buildpacks builds and keep application images up-to-date. 11 | 12 | [kpack][kpack] is part of the [Buildpacks Community](https://github.com/buildpacks-community) organization. 13 | 14 | 15 | 16 | ## Use 17 | To use [kpack][kpack] you can follow their [tutorial][tutorial] for details on how to create a builder and use it to create application images. 18 | An example `kpack Image` configuration looks like - 19 | 20 | ```yaml 21 | apiVersion: kpack.io/v1alpha1 22 | kind: Image 23 | metadata: 24 | name: example-image 25 | namespace: default 26 | spec: 27 | tag: 28 | serviceAccount: 29 | builder: 30 | name: 31 | kind: Builder 32 | source: 33 | git: 34 | url: 35 | revision: 36 | ``` 37 | 38 | kpack is also accompanied by a handy CLI utility called [kpack CLI][cli] that lets you interact with kpack resources. 39 | 40 | 41 | ### References 42 | 43 | - [kpack GitHub repository][kpack] 44 | - [kpack CLI Github repository][cli] 45 | - [kpack tutorial][tutorial] 46 | - [kpack Donation announcement][announcement] 47 | 48 | [kpack]: https://github.com/buildpacks-community/kpack 49 | [tutorial]: https://github.com/buildpacks-community/kpack/blob/main/docs/tutorial.md 50 | [cli]: https://github.com/buildpacks-community/kpack-cli/blob/main/docs/kp.md 51 | [buildpacks]: https://buildpacks.io 52 | [announcement]: https://medium.com/buildpacks/kpack-joins-the-buildpacks-community-organization-223e59bda951 53 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/platform.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="What is a platform?" 4 | aliases=[ 5 | "/docs/concepts/components/platform" 6 | ] 7 | weight=4 8 | +++ 9 | 10 | A `platform` orchestrates [builds][build] by invoking the [lifecycle] binary together with [buildpacks][buildpack] and 11 | application source code to produce a runnable OCI image. 12 | 13 | 14 | 15 | ## Examples 16 | 17 | Examples of a platform might include: 18 | 19 | * A local CLI tool that uses buildpacks to create OCI images. One such tool is the [Pack CLI][pack] 20 | * A plugin for a continuous integration service that uses buildpacks to create OCI images. One such plugin is the [buildpacks][buildpacks-tekton] plugin in [Tekton] 21 | * A cloud application platform that uses buildpacks to build source code before deployment. One such platform is [kpack][kpack] 22 | 23 | ## API 24 | 25 | The platform [specification][spec] details what a platform does, and how it interacts with lifecycles and builders. 26 | 27 | For the latest version of the Platform API, see [releases][releases] on the spec repo. 28 | 29 | [api-version]: https://github.com/buildpacks/spec/blob/main/platform.md#platform-api-version 30 | [build]: /docs/for-platform-operators/concepts/lifecycle/ 31 | [builder]: /docs/for-app-developers/concepts/builder/ 32 | [buildpack]: /docs/for-app-developers/concepts/buildpack/ 33 | [buildpacks-tekton]: https://github.com/tektoncd/catalog/tree/master/task/buildpacks 34 | [kpack]: https://github.com/buildpacks-community/kpack 35 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 36 | [pack]: https://github.com/buildpacks/pack 37 | [releases]: https://github.com/buildpacks/spec/releases?q=platform 38 | [spec]: https://github.com/buildpacks/spec/blob/main/platform.md 39 | [tekton]: https://tekton.dev/ 40 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/list-item.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/builder.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a builder?" 3 | weight=2 4 | +++ 5 | 6 | A `builder` is an [OCI image](https://github.com/opencontainers/image-spec) containing 7 | an ordered combination of [buildpacks][buildpack] and 8 | a [build-time base image], a [lifecycle] binary, and a reference to a [runtime base image]. 9 | 10 | 11 | 12 | The [build-time base image] provides the base environment for the `builder` 13 | (e.g., an Ubuntu Noble OS image with build tooling) and 14 | a [runtime base image] provides the base environment for the `app image` during runtime. 15 | 16 | ![builder](/images/builder.svg) 17 | 18 | Under the hood a builder uses the [lifecycle] to run the `detect` phase for all the `buildpacks` it contains, in order, 19 | and then proceeds to run the `build` phase for all the `buildpacks` that passed detection. 20 | 21 | This allows us to have a **single** `builder` that can detect and build various kinds of applications automatically. 22 | 23 | For example, let's say `demo-builder` contains the `Python` and `Node` buildpack. Then - 24 | 25 | - If your project just has a `requirements.txt`, `demo-builder` will only run the Python `build` steps. 26 | - If your project just has a `package-lock.json`, `demo-builder` will only run the Node `build` steps. 27 | - If your project has both `package-lock.json` and `requirements.txt`, `demo-builder` will run **both** the Python and Node `build` steps. 28 | - If your project has no related files, `demo-builder` will fail to `detect` and exit. 29 | 30 | [build-time base image]: /docs/for-app-developers/concepts/base-images/build/ 31 | [buildpack]: /docs/for-app-developers/concepts/buildpack/ 32 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 33 | [runtime base image]: /docs/for-app-developers/concepts/base-images/run/ 34 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/experimental-features.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What are experimental features?" 3 | weight=8 4 | +++ 5 | 6 | Certain features are considered `experimental` and susceptible to change in future API versions. 7 | 8 | 9 | 10 | This means users will need to enable the `experimental` mode in order to use one of these features. 11 | 12 | If using `pack`, run `pack config experimental true`, or add `experimental = true` to your `~/.pack/config.toml` file to enable experimental features. 13 | 14 | If using the `lifecycle` directly, set the `CNB_EXPERIMENTAL_MODE` [environment variable](https://github.com/buildpacks/spec/blob/main/platform.md#experimental-features). 15 | 16 | The following features are experimental for `pack`: 17 | 18 | * building for [Windows containers][windows] 19 | * exporting to [OCI layout][oci-layout] format on disk 20 | * Interacting with the [buildpack registry][registry] 21 | * `pack manifest` commands 22 | * `pack buildpack --flatten` 23 | * `pack build --interactive` 24 | * When building, reading project metadata version & source URL from [project.toml][project-descriptor] 25 | 26 | The following features are experimental for `lifecycle`: 27 | 28 | * Building for [Windows containers][windows] 29 | * Exporting to [OCI layout][oci-layout] format on disk 30 | 31 | For more information and to look at an example of how this might be valuable, see [Export to OCI layout format on disk][oci-layout]. 32 | 33 | [oci-layout]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/export-to-oci-layout/ 34 | [project-descriptor]: https://buildpacks.io/docs/reference/config/project-descriptor/ 35 | [registry]: https://buildpacks.io/docs/for-buildpack-authors/how-to/distribute-buildpacks/publish-buildpack/ 36 | [windows]: https://buildpacks.io/docs/for-app-developers/how-to/special-cases/build-for-windows/ 37 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/distribute-buildpacks/craft-order.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Craft a buildpack order" 3 | weight=99 4 | +++ 5 | 6 | An `order` is a list of one or more `groups` to be tested against application source code, so that the appropriate `group` for a build can be determined. 7 | 8 | 9 | 10 | Whereas a `buildpack group`, or `group`, is a list of one or more buildpacks that are designed to work together. For example, a buildpack that provides `node` and a buildpack that provides `npm`. 11 | 12 | During the `detect` phase, an order definition for buildpacks and an order definition for image extensions—if present—MUST be resolved into a group of component buildpacks and a group of image extensions. 13 | 14 | ## Composite Buildpacks 15 | 16 | A **composite buildpack** is a buildpack that doesn't contain any `/bin/detect` or `/bin/build` executables; instead it references other buildpacks in its `buildpack.toml` via the `[[order]]` array. Composite buildpacks MUST be [resolvable](https://github.com/buildpacks/spec/blob/main/buildpack.md#order-resolution) into a collection of component buildpacks. That is, after the [detect phase](https://buildpacks.io/docs/for-buildpack-authors/concepts/lifecycle-phases/#phase-2-detect) of the lifecycle has completed, a single group of component buildpacks from the `[[order]]` array will have opted in to the build. 17 | 18 | ## Why use Composite Buildpacks 19 | 20 | Most advanced buildpacks aren’t actually a single buildpack, but instead a composite or an ordered list of component buildpacks with each buildpack performing specific jobs. This is useful for composing more complex detection strategies. 21 | 22 | >For more details on composite buildpacks, buildpack groups, and order resolution, see the [concept page](https://buildpacks.io/docs/for-buildpack-authors/concepts/buildpack-group/) for buildpack groups. 23 | -------------------------------------------------------------------------------- /content/docs/reference/config/package-config.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="package.toml" 3 | aliases=[ 4 | "/docs/reference/package-config/", 5 | ] 6 | weight=4 7 | +++ 8 | 9 | The package config file is used for packaging buildpacks for distribution as OCI images or tar files. 10 | 11 | 12 | 13 | The schema is as follows: 14 | 15 | - #### `buildpack` _(required)_ 16 | The buildpack to package. It must contain the following field: 17 | 18 | - **`uri`** _(string, required)_\ 19 | A URL or path to an [archive][supported-archives], or a path to a directory. If path is relative, it must be relative to the `package.toml`. 20 | 21 | - #### `dependencies` _(list, optional)_ 22 | A set of dependent buildpack locations, for packaging a composite buildpack (sometimes referred to as a "meta buildpack"). Each dependent buildpack location must correspond to an [order group][order-group] within the composite buildpack being packaged, and must have **one** of the following fields: 23 | 24 | - **`uri`** _(string)_\ 25 | A URL or path to an [archive][supported-archives], a packaged buildpack (saved as a `.cnb` file), or a directory. If path is relative, it must be relative to the `package.toml`. 26 | 27 | - #### `platform` _(optional)_ 28 | The expected runtime environment for the buildpackage. It should contain the following field: 29 | 30 | - **`os`** _(string, optional)_\ 31 | The operating system type that the buildpackage will run on. Only `linux` or `windows` is supported. If omitted, `linux` will be the default. 32 | 33 | 34 | ## Further Reading 35 | 36 | You can view [sample buildpackages](https://github.com/buildpacks/samples/tree/main/packages) on Github. 37 | 38 | [package]: /docs/for-platform-operators/concepts/buildpack#distribution 39 | [supported-archives]: /docs/reference/builder-config#supported-archives 40 | [order-group]: https://github.com/buildpacks/spec/blob/main/buildpack.md#order-resolution 41 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/build-env.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Specify the build time environment variables" 3 | weight=4 4 | +++ 5 | 6 | `Environment variables` are used to configure buildpack behavior. They may be specified by: 7 | 8 | * The platform operator (this page) 9 | * The end user (see [Customize buildpack behavior with build-time environment variables][end user]) 10 | * Other buildpacks (see [Specify the environment][env]) 11 | 12 | 13 | 14 | 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. 15 | 16 | The platform operator specifies `environment variables` in a manner that is very similar to buildpacks (see XXX), but with a few differences. Namely: 17 | 18 | * The directory for environment variable settings `/cnb/build-config` 19 | * When no suffix is provided, the modification behavior is `default` 20 | For more information, consult the [Platform Specification](https://github.com/buildpacks/spec/blob/main/platform.md). 21 | 22 | ### Example 23 | 24 | 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. 25 | 26 | ```bash 27 | $ tree /cnb/buildconfig/env 28 | ├── CGO_ENABLED.override 29 | ├── PIP_VERBOSE 30 | └── CLASSPATH.prepend 31 | ``` 32 | 33 | [env]: https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/specify-env/ 34 | [end user]: https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment/ 35 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/export.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Export" 3 | aliases=[ 4 | "/docs/concepts/components/lifecycle/export" 5 | ] 6 | weight=5 7 | +++ 8 | 9 | The `exporter` creates the final `OCI image` and updates the image config with new metadata to reflect the latest changes. 10 | 11 | 12 | 13 | ### Exit Codes 14 | 15 | | Exit Code | Result | 16 | |-----------------|-------------------------------------| 17 | | `0` | Success | 18 | | `11` | Platform API incompatibility error | 19 | | `12` | Buildpack API incompatibility error | 20 | | `1-10`, `13-19` | Generic lifecycle errors | 21 | | `60-69` | Export-specific lifecycle errors | 22 | 23 | ### Image 24 | 25 | The `exporter` accepts as an argument the `` tag reference to which the app image will be written, either in an `OCI image` registry or a `docker daemon`. 26 | 27 | * At least one `` must be provided. 28 | * Each `` must be a valid tag reference. 29 | * If `` is false and more than one `` is provided they must refer to the same registry. 30 | * The `` will be read from `analyzed.toml`. 31 | 32 | ### report.toml 33 | 34 | The `exporter` will write a [`report.toml`](https://github.com/buildpacks/spec/blob/main/platform.md#reporttoml-toml) containing information about the exported image such as its digest and manifest size (if exported to an `OCI registry`) or identifier, and any build BOM contributed by buildpacks. The location of the output report can be specified by passing the `-report` flag; by default, it is written to `/report.toml` - note that this is NOT present in the filesystem of the exported image. 35 | 36 | *** 37 | 38 | For more information about the `exporter`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#exporter). 39 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_hero.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Hero 4 | 5 | **********************************/ 6 | @keyframes colorIn { 7 | 0% { filter: grayscale(1); } 8 | 100% { filter: grayscale(0); } 9 | } 10 | 11 | .hero { 12 | background-image: url("/images/bg-pattern.png"); 13 | background-color: $blue-light; 14 | background-blend-mode: multiply; 15 | 16 | .container { 17 | padding: 4vw; 18 | text-align: center; 19 | 20 | .strong { 21 | font-weight: bold; 22 | } 23 | 24 | h2 { 25 | font-weight: 300; 26 | color: $white; 27 | text-shadow: 2px 2px rgba($black, .2); 28 | } 29 | 30 | .button-holder { 31 | display: flex; 32 | flex-direction: column; 33 | justify-content: center; 34 | align-items: center; 35 | margin-bottom: 0; 36 | } 37 | 38 | .button { 39 | margin: 20px 0 10px; 40 | max-width: 200px; 41 | box-shadow: 2px 2px rgba($black, .1); 42 | } 43 | 44 | .nav-item { 45 | .nav-link { 46 | margin-right: 10px; 47 | border-top-left-radius: 0; 48 | border-top-right-radius: 0; 49 | background-color: $blue-dark; 50 | opacity: 1; 51 | 52 | &:not(.active) { 53 | img { 54 | filter: grayscale(1.0); 55 | } 56 | 57 | &:hover { 58 | img { 59 | animation: colorIn 500ms; 60 | filter: none; 61 | } 62 | } 63 | } 64 | 65 | &.active { 66 | background-color: $white; 67 | color: $white !important; 68 | } 69 | } 70 | } 71 | } 72 | 73 | @media (min-width: 768px) { 74 | .container.hero { 75 | .button-holder { 76 | flex-direction: row; 77 | } 78 | 79 | .button { 80 | margin-right: 20px; 81 | margin-bottom: 0; 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/header.html: -------------------------------------------------------------------------------- 1 |
2 | 38 |
39 | -------------------------------------------------------------------------------- /themes/buildpacks/static/images/learn-icon.svg: -------------------------------------------------------------------------------- 1 | Layer 1 -------------------------------------------------------------------------------- /content/docs/.common/concepts/buildpack.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a buildpack?" 3 | weight=1 4 | +++ 5 | 6 | A `buildpack` is software that transforms application source code into runnable artifacts 7 | by analyzing the code and determining the best way to build it. 8 | 9 | 10 | 11 | ![buildpacks](/images/what.svg) 12 | 13 | ## Why buildpacks? 14 | 15 | Buildpacks allow application developers to focus on what they do best - writing code, without having to worry about image security, optimizing container images, or container build strategy. 16 | 17 | How much time have you spent struggling to wrangle yet another Dockerfile? Copying and pasting random Dockerfile snippets into every project? Buildpacks can help! They are a better approach to building container images for applications. 18 | 19 | ## What do they look like? 20 | 21 | Typical buildpacks consist of at least three files: 22 | 23 | * `buildpack.toml` -- provides metadata about the buildpack, containing information such as its name, ID, and version. 24 | * `bin/detect` -- performs [detect](#detect). 25 | * `bin/build` -- performs [build](#build). 26 | 27 | ## How do they work? 28 | 29 | ![how](/images/how.svg) 30 | 31 | **Each buildpack has two jobs to do** 32 | 33 | ### Detect 34 | 35 | The buildpack determines if it is needed or not. 36 | 37 | For example: 38 | 39 | - A Python buildpack may look for a `requirements.txt` or a `setup.py` file. 40 | - A Node buildpack may look for a `package-lock.json` file. 41 | 42 | ### Build 43 | 44 | The buildpack transforms application source code in some way, for example by 45 | 46 | - Setting build-time and run-time environment variables. 47 | - Downloading dependencies. 48 | - Running source code compilation (if needed). 49 | - Configuring the application entrypoint and any startup scripts. 50 | 51 | For example: 52 | 53 | - A Python buildpack may run `pip install -r requirements.txt` if it detected a `requirements.txt` file. 54 | - A Node buildpack may run `npm install` if it detected a `package-lock.json` file. 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docs for [Cloud Native Buildpacks](https://buildpacks.io) 2 | 3 | [![](https://github.com/buildpacks/docs/workflows/Deploy/badge.svg)](https://github.com/buildpacks/docs/actions) 4 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/buildpacks/docs) 5 | 6 | ## Preview 7 | 8 | This repository contains the documentation for Cloud Native Buildpacks (CNBs), which are pluggable and modular tools that translate application source code into OCI container images. 9 | 10 | Read more about Cloud Native Buildpacks, the features they offer, and the story behind the project on our [website](https://buildpacks.io/). 11 | 12 | ![buildpacks.io](https://image.thum.io/get/https://buildpacks.io) 13 | 14 | ## Management 15 | 16 | ### Calendar 17 | 18 | The calendar is managed via [teamup](https://teamup.com/ksxw26c3km72mq3imn). To request an alteration you may [create an issue](https://github.com/buildpacks/community/issues/new), reach out to a maintainer via [slack](https://slack.cncf.io) in #buildpacks-maintainers, or post in [discussions](https://github.com/buildpacks/community/discussions). 19 | 20 | ## Contributing 21 | 22 | We ❤ contributions. 23 | 24 | Cloud Native Buildpacks is better because of our contributors and maintainers. It is because of you that we can bring great software to the community. 25 | 26 | To get more involved with the project, read our [CONTRIBUTING][contributing], [RELEASE][release] and [DEVELOPMENT][development] documents. 27 | 28 | [contributing]: https://github.com/buildpacks/.github/blob/main/CONTRIBUTING.md 29 | [development]: DEVELOPMENT.md 30 | [release]: RELEASE.md 31 | 32 | Thanks for your interest in the Cloud Native Buildpacks project; your contributions are greatly valued and appreciated. 33 | 34 | ## Stay Updated 35 | 36 | To get the latest updates on the project, follow us on [X](https://twitter.com/buildpacks_io), check out our [blog](https://medium.com/buildpacks), or join our [mailing list](https://lists.cncf.io/g/cncf-buildpacks). 37 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/_default/community.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |
4 | 5 |
6 |
7 |
8 |
9 |
10 | {{ readFile "themes/buildpacks/static/images/community.svg" | safeHTML }} 11 |
12 |
13 |
15 |
16 |

Join our community

17 |
18 | Slack 19 | Find us in the #buildpacks channel. 20 |
21 |
22 | Also... 23 | 29 |
30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 |
39 | {{ .Content }} 40 |
41 |
42 |
43 |
44 | 45 | 46 | {{ end }} 47 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-outputs/download-sbom.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Download a Software Bill-of-Materials (SBOM)" 4 | aliases=[ 5 | "/docs/features/bill-of-materials" 6 | ] 7 | summary="An SBOM can give you a layer-by-layer view of what's inside your application image." 8 | weight=3 9 | +++ 10 | 11 | ## Summary 12 | 13 | A **Software-Bill-of-Materials** (`SBOM`) lists all the software components included in an image. Cloud Native Buildpacks provides all the transparency you need to have confidence in your image supply chain. Software-Bill-of-Materials in [CycloneDX](https://cyclonedx.org/), [Syft](https://github.com/anchore/syft) and [Spdx](https://spdx.dev/) formats are supported. 14 | 15 | 1. Buildpacks can populate `SBOM` information about the dependencies they have provided. 16 | 17 | ## Viewing Bill of Materials 18 | 19 | You can use the `sbom download` command to inspect your app for its Software-Bill-of-Materials. The following command will download the application layer containing the `SBOM` files to `./layers/sbom/...` on your local filesystem. 20 | 21 | ```bash 22 | pack sbom download your-image-name 23 | ``` 24 | 25 | You can also choose to download the `SBOM` from an image hosted in a remote registry, as opposed to an image hosted in a Docker daemon. You use the `--remote` flag to do so. 26 | 27 | ```bash 28 | pack sbom download your-image-name --remote 29 | ``` 30 | 31 | The following example demonstrates running `pack sbom download ...` on an image containing an `SBOM` in `syft` format. Running `pack sbom download ...` creates a `layers/sbom` directory and populates that directory with `sbom.syft.json` files. The combined metadata from all of the `sbom.syft.json` files is the image `SBOM`. Where an image generates CycloneDX `SBOM` metadata, the files are named `sbom.cdx.json`. Similarly, Spdx files are named `sbom.spdx.json`. 32 | 33 | ```bash 34 | layers 35 | └── sbom 36 | └── launch 37 | └── paketo-buildpacks_ca-certificates 38 | ├── helper 39 | │ └── sbom.syft.json 40 | └── sbom.syft.json 41 | ``` 42 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/buildpack-api-0.8-0.9.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Buildpack API 0.8 -> 0.9" 4 | aliases=[ 5 | "/docs/reference/spec/migration/buildpack-api-0.8-0.9" 6 | ] 7 | weight=5 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to buildpack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.9) for Buildpack API 0.9 for the full list of changes and further details. 15 | 16 | ### Shell removal 17 | 18 | Buildpack-defined processes may no longer implicitly rely on a shell (be non-direct). 19 | 20 | In `launch.toml`, `direct` is removed as a key in the `[[processes]]` table, and all processes are inferred to be `direct = true`. 21 | 22 | Buildpack processes can still use a shell! However, the `command` must now explicitly begin with `/bin/sh` (or `cmd.exe` on Windows). 23 | 24 | ### Overridable process arguments 25 | 26 | Hand-in-hand with shell removal is the introduction of overridable process arguments. 27 | 28 | In `launch.toml`, `command` is now a list. The first element in `command` is the command, and all following entries are arguments that are always provided to the process, regardless of how the application is started. The `args` list now designates arguments that can be overridden by the end user - if supported by the platform (Platform API version 0.10 and above). 29 | 30 | For further details, see the platform [migration guide](/docs/for-platform-operators/how-to/migrate/platform-api-0.9-0.10). 31 | 32 | For older platforms (Platform API version 0.9 and below), arguments in `command` will be prepended to arguments in `args`, negating the new functionality (but preserving compatibility). 33 | 34 | ### Image extensions are supported (experimental) 35 | 36 | Platform 0.10 introduces image extensions as experimental components for customizing build and run-time base images (see [here](/docs/for-platform-operators/concepts/extension) for more information). 37 | 38 | For more information, see our tutorial on [authoring an image extension](/docs/for-buildpack-authors/tutorials/basic-extension). 39 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/basic-buildpack/03_detection.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Detecting your application" 4 | aliases=[ 5 | "/docs/buildpack-author-guide/create-buildpack/detection" 6 | ] 7 | weight=3 8 | +++ 9 | 10 | 11 | 12 | Next, you will want to actually detect that the app you are building is a node-js app. In order to do this, you will need to check for a `package.json`. 13 | 14 | Replace `exit 1` in the `detect` script with the following check: 15 | 16 | ```bash 17 | if [[ ! -f package.json ]]; then 18 | exit 100 19 | fi 20 | ``` 21 | 22 | Your `node-js-buildpack/bin/detect` script should look like this: 23 | 24 | 25 | ```bash 26 | #!/usr/bin/env bash 27 | set -eo pipefail 28 | 29 | if [[ ! -f package.json ]]; then 30 | exit 100 31 | fi 32 | ``` 33 | 34 | Next, rebuild your app with the updated buildpack: 35 | 36 | 37 | ```bash 38 | pack build test-node-js-app --path ./node-js-sample-app --buildpack ./node-js-buildpack 39 | ``` 40 | 41 | 42 | You should see the following output: 43 | 44 | ``` 45 | Previous image with name "test-node-js-app" not found 46 | ===> DETECTING 47 | examples/node-js 0.0.1 48 | ===> RESTORING 49 | ===> BUILDING 50 | ---> node-js Buildpack 51 | ERROR: failed to build: exit status 1 52 | ERROR: failed to build: executing lifecycle: failed with status code: 51 53 | ``` 54 | 55 | Notice that `detect` now passes because there is a valid `package.json` in the NodeJS app at `node-js-sample-app`, but now `build` fails because it is currently written to error out. 56 | 57 | You will also notice that `RESTORING` now appears in the build output. This step is part of the buildpack lifecycle that looks to see if any previous image builds have layers that the buildpack can re-use. We will get into this topic in more detail later. 58 | 59 | 60 | --- 61 | 62 | Next Step 63 | 64 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ partial "meta.html" . }} 6 | 7 | 9 | 10 | 11 | 13 | 16 | 17 | {{ $style := resources.Get "scss/site.scss" | toCSS }} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 37 | 38 | {{ .Title | plainify }} · {{ .Site.Title }} 39 | 40 | 41 | 42 | {{ partial "header.html" . }} 43 | {{ block "main" . }}{{ end }} 44 | {{ partial "footer.html" . }} 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | {{ $isHome := .IsHome }} 2 | {{ $summary := .Summary | plainify | truncate 199 "…" }} 3 | {{ $description := cond $isHome site.Params.description $summary }} 4 | 5 | 6 | 7 | {{ with $description -}} 8 | 9 | {{- end }} 10 | 11 | 12 | 13 | {{ $title := cond $isHome site.Title (printf "%s · %s" .Title site.Title) }} 14 | {{ $ogImageUrl := ("images/buildpacks-social-card.jpg" | absURL) }} 15 | {{ $ogType := cond $isHome "website" "article" }} 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | {{ with $description -}} 24 | 25 | {{- end }} 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {{ $twType := cond $isHome "summary_large_image" "summary"}} 34 | {{ $twImageUrl := (cond $isHome "images/buildpacks-social-card.jpg" "images/buildpacks-social-card-square.jpg" ) | absURL }} 35 | {{ $twHandle := site.Params.twitter_handle }} 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | repository_dispatch: 11 | types: 12 | - pack-release 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Git Checkout 19 | uses: actions/checkout@v4 20 | - name: Setup Go environment 21 | uses: actions/setup-go@v6 22 | with: 23 | go-version: '1.x' 24 | # Node is used to generate the pagefind index 25 | - name: Setup Node.js environment 26 | uses: actions/setup-node@v6 27 | with: 28 | node-version: 'latest' 29 | - name: Install Dependencies 30 | run: sudo apt-get install make curl jq 31 | - name: Install pack 32 | uses: buildpacks/github-actions/setup-pack@v5.9.5 33 | with: 34 | pack-version: '0.38.2' 35 | - name: Test 36 | run: make test 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | - name: Build 40 | run: make build 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | - name: Check links 44 | run: | 45 | make check-links 46 | - name: Upload public folder 47 | uses: actions/upload-artifact@v5 48 | env: 49 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 | with: 51 | name: public 52 | path: ./public 53 | 54 | deploy: 55 | if: (github.event_name == 'repository_dispatch') || (github.event_name == 'push' && github.ref == 'refs/heads/main') 56 | needs: build 57 | runs-on: ubuntu-latest 58 | steps: 59 | - name: Download public folder 60 | uses: actions/download-artifact@v4 61 | with: 62 | name: public 63 | path: ./public 64 | - name: Deploy 65 | uses: peaceiris/actions-gh-pages@v4 66 | with: 67 | github_token: ${{ secrets.GITHUB_TOKEN }} 68 | publish_dir: ./public 69 | cname: buildpacks.io 70 | full_commit_message: ${{ github.event.head_commit.message }} 71 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/deprecated/buildpack-api-0.4-0.5.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Buildpack API 0.4 -> 0.5" 4 | aliases=[ 5 | "/docs/reference/spec/migration/buildpack-api-0.4-0.5" 6 | ] 7 | weight=1 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to buildpack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.5) for Buildpack API 0.5 for the full list of changes and further details. 15 | 16 | ### Stack ID 17 | The buildpack may now indicate compatibility with any stack by specifying the special value `*`. 18 | 19 | ### Character restrictions for process types 20 | For each process in `launch.toml`, `type` is now restricted to only contain numbers, letters, and the characters `.`, `_`, and `-`, so symlinks on both Linux and windows filesystems can be created. 21 | 22 | ### Override env vars 23 | Override is now the default behavior for env files without a suffix. 24 | It means that for the `/env/`, `/env.build/`, and `/env.launch/` directories, the default, suffix-less behavior will be `VAR.override` instead of `VAR.append`+`VAR.delim=:`. 25 | 26 | ### Decouple Builpack Plan and BOM 27 | The Buildpack Plan and Bill-Of-Materials are now decoupled. 28 | `` that is provided to `/bin/build` and contains the Buildpack Plan entries for the buildpack, is now read-only. 29 | There are new `[[bom]]` sections in `/launch.toml` and `/build.toml` for runtime and build-time Bill-of-Materials entries respectively. 30 | There is a new `[[entries]]` section in `/build.toml` for Buildpack Plan entries that should be passed to subsequent buildpacks that may provide the dependencies. 31 | 32 | ### exec.d 33 | The launch process now supports `exec.d` executables. Unlike `profile.d` scripts, which must be text files containing Bash 3+ scripts, the `exec.d` scripts do not depend on a shell but can still modify the environment of the app process. 34 | Lifecycle will execute each file in each `//exec.d` directory and each file in each `//exec.d/` directory. 35 | The output of the script may contain any number of top-level key/value pairs. 36 | -------------------------------------------------------------------------------- /tools/get_pack_commands.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "log" 7 | "os" 8 | "path" 9 | "path/filepath" 10 | "strings" 11 | 12 | "github.com/buildpacks/pack/cmd" 13 | "github.com/buildpacks/pack/pkg/logging" 14 | "github.com/spf13/cobra/doc" 15 | ) 16 | 17 | const ( 18 | cliDir = "/docs/for-platform-operators/how-to/integrate-ci/pack/cli/" 19 | outputPath = "../content" + cliDir 20 | indexFile = `_index.md` 21 | 22 | gendocFrontmatterTemplate = `+++ 23 | title="%s" 24 | no_edit="true" 25 | aliases=[ "%s" ] 26 | +++ 27 | 28 | ` 29 | ) 30 | 31 | var filePrepender = func(filename string) string { 32 | name := filepath.Base(filename) 33 | name = strings.Replace(name, ".md", "", -1) 34 | presentationName := strings.Replace(name, "_", " ", -1) 35 | alias := fmt.Sprintf("/docs/tools/pack/cli/%s", name) 36 | return fmt.Sprintf(gendocFrontmatterTemplate, presentationName, alias) 37 | } 38 | 39 | var linkHandler = func(name string) string { 40 | base := strings.TrimSuffix(name, path.Ext(name)) 41 | return cliDir + strings.ToLower(base) + "/" 42 | } 43 | 44 | func main() { 45 | packCmd, err := cmd.NewPackCommand(newLogger()) 46 | if err != nil { 47 | log.Fatal(err) 48 | } 49 | packCmd.DisableAutoGenTag = true 50 | 51 | if _, err := os.Stat(outputPath); os.IsNotExist(err) { 52 | if err := os.MkdirAll(outputPath, 0777); err != nil { 53 | log.Fatal(err) 54 | } 55 | } 56 | 57 | if _, err := os.Stat(filepath.Join(outputPath, indexFile)); os.IsNotExist(err) { 58 | if err := os.WriteFile(filepath.Join(outputPath, indexFile), []byte(filePrepender("Pack CLI")), os.ModePerm); err != nil { 59 | log.Fatal(err) 60 | } 61 | } 62 | 63 | err = doc.GenMarkdownTreeCustom(packCmd, outputPath, filePrepender, linkHandler) 64 | if err != nil { 65 | log.Fatal(err) 66 | } 67 | } 68 | 69 | type packLogger struct { 70 | logging.Logger 71 | } 72 | 73 | func (l packLogger) WantTime(f bool) {} 74 | func (l packLogger) WantQuiet(f bool) {} 75 | func (l packLogger) WantVerbose(f bool) {} 76 | 77 | func newLogger() packLogger { 78 | log := logging.NewSimpleLogger(ioutil.Discard) 79 | return packLogger{ 80 | log, 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/podman-setup.html: -------------------------------------------------------------------------------- 1 |
2 | 11 |
12 | {{ range $os := $.Site.Data.podman.setup }} 13 | {{ $cssClasses := "" }} 14 | {{ if $os.default }} 15 | {{ $cssClasses = "active in show" }} 16 | {{ end }} 17 |
18 |
19 | 29 |
30 | {{ range $method := $os.methods }} 31 | {{ $methodID := (print ($os.name | urlize) "-" (replace $method.name "." "-") | urlize) }} 32 | {{ $cssClasses := "" }} 33 | {{ if $method.default }} 34 | {{ $cssClasses = "active in show" }} 35 | {{ end }} 36 |
37 | {{ $method.install | markdownify }} 38 | {{ $method.setup | markdownify }} 39 |
40 | {{ end }} 41 |
42 |
43 |
44 | {{ end }} 45 |
46 |
47 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/buildpack-api-0.7-0.8.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Buildpack API 0.7 -> 0.8" 4 | aliases=[ 5 | "/docs/reference/spec/migration/buildpack-api-0.7-0.8" 6 | ] 7 | weight=4 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to buildpack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.8) for Buildpack API 0.8 for the full list of changes and further details. 15 | 16 | ### Process-Specific Working Directory 17 | 18 | Buildpacks may specify the working directory for a process by setting the `working-dir` field on the process in [`launch.toml`](https://github.com/buildpacks/spec/blob/buildpack/0.8/buildpack.md#launchtoml-toml). 19 | 20 | Prior to this, all processes ran from the app directory (`CNB_APP_DIR`). 21 | Running a process from a different directory typically involved running a shell to execute a `cd` command and then start the process, like: 22 | 23 | ``` 24 | [[processes]] 25 | command = "bash" 26 | args = ["-c", "cd && "] 27 | ``` 28 | 29 | Buildpacks can now specify the process directly with a specific working directory, like: 30 | 31 | ``` 32 | [[processes]] 33 | command = "" 34 | working-dir = "" 35 | ``` 36 | 37 | For details, see [RFC 81](https://github.com/buildpacks/rfcs/blob/main/text/0081-process-specific-working-directory.md). 38 | 39 | ### Deprecate Positional Args to `build` and `detect` Executables 40 | 41 | The positional arguments to the `detect` and `build` executables are deprecated. 42 | Lifecycle now accepts these values as environment variables. 43 | 44 | To upgrade, buildpack authors should use the following environment variables: 45 | 46 | For `detect`: 47 | 48 | - `CNB_PLATFORM_DIR` replaces the first positional argument. 49 | - `CNB_BUILD_PLAN_PATH` replaces the second positional argument. 50 | 51 | For `build`: 52 | 53 | * `CNB_LAYERS_DIR` replaces the first positional argument. 54 | * `CNB_PLATFORM_DIR` replaces the second positional argument. 55 | * `CNB_BP_PLAN_PATH` replaces the third positional argument. 56 | 57 | For details, see [RFC 100](https://github.com/buildpacks/rfcs/blob/main/text/0100-buildpack-input-vars.md). 58 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Create slice layers" 3 | weight=99 4 | +++ 5 | 6 | After all buildpacks have executed, the contents of the application directory will be included in the final application image as a single layer, OR as `slice` layers. A `slice` layer contains a portion of the application directory as defined by a `filepath` glob. 7 | 8 | 9 | 10 | `Slices` are useful to avoid re-uploading unchanged data to the image registry. For example, if the application directory is a monolithic repository containing code for both a web frontend and sever backend, buildpacks can slice the directory into separate layers. Thus developers iterating on one part of the code base don't have to wait for the entire directory to re-upload at the end of the build. 11 | 12 | ## Key Points 13 | 14 | * For each `slice`, buildpacks MUST specify zero or more `path globs` such that each path is either: 15 | * Relative to the root of the app directory without traversing outside of the app directory 16 | * Absolute and contained within the app directory 17 | * `Path globs` MUST: 18 | * Follow the pattern syntax defined in the [Go standard library](https://golang.org/pkg/path/filepath/#Match) 19 | * Match zero or more files or directories 20 | * `Slices` from earlier buildpacks are processed before `slices` from later buildpacks. When a file is included in a `slice`, it is as if it no longer exists in the application directory for processing future `slices`. 21 | 22 | ## Implementation Steps 23 | 24 | `Slices` are added to the [launch.toml](https://github.com/buildpacks/spec/blob/main/buildpack.md#launchtoml-toml) file in the `/` directory as follows: 25 | 26 | ```toml 27 | [[slices]] 28 | paths = [""] 29 | ``` 30 | 31 | A buildpack may specify sub-paths within `` as `slices` in `launch.toml`. The lifecycle will create separate layers during the [export](https://buildpacks.io/docs/for-buildpack-authors/concepts/lifecycle-phases/#phase-5-export) phase for each slice containing one or more files or directories. Any files in the `` directory that are not included in buildpack-defined slices will be included in the image as a final slice layer. 32 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Create a run base image" 4 | aliases=[ 5 | "/docs/operator-guide/create-run-base" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | The runtime base image provides the OS-level dependencies for applications at runtime. 11 | 12 | 13 | 14 | ## Define a run base image for your CNB build 15 | 16 | We need a Dockerfile similar to the following: 17 | 18 | ```Dockerfile 19 | # Define the base image 20 | FROM ubuntu:noble 21 | 22 | # Install packages that we want to make available at run time 23 | RUN apt-get update && \ 24 | apt-get install -y xz-utils ca-certificates && \ 25 | rm -rf /var/lib/apt/lists/* 26 | 27 | # Create user and group 28 | ARG cnb_uid=1000 29 | ARG cnb_gid=1000 30 | RUN groupadd cnb --gid ${cnb_gid} && \ 31 | useradd --uid ${cnb_uid} --gid ${cnb_gid} -m -s /bin/bash cnb 32 | 33 | # Set user and group 34 | USER ${cnb_uid}:${cnb_gid} 35 | 36 | # Set required CNB target information 37 | LABEL io.buildpacks.base.distro.name="your distro name" 38 | LABEL io.buildpacks.base.distro.version="your distro version" 39 | ``` 40 | 41 | ### Define the base image 42 | 43 | We start with `ubuntu:noble` as our base image. 44 | You can use any operating system, operating system distribution, and operating system distribution version of your choosing, 45 | as long as your application will run there. 46 | 47 | ### Install packages that we want to make available at run time 48 | 49 | Install any system packages that your application will need. 50 | 51 | ### Create user and group, set user and group 52 | 53 | The `USER` in the image config may be different from the build-time user (though the group ID should probably be the same). 54 | You should consult the documentation for your buildpacks to determine what is supported. 55 | 56 | ### Set required CNB target information 57 | 58 | Finally, we need to label the image with operating system distribution information for platforms and the lifecycle to use. 59 | 60 | To determine which values to provide, see [targets](/docs/for-buildpack-authors/concepts/targets/) concept information. 61 | 62 | ## Build the run base image 63 | 64 | ```bash 65 | docker build . -t cnbs/sample-base-run:noble 66 | ``` 67 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/shortcodes/pack-install.html: -------------------------------------------------------------------------------- 1 | {{ $pack_version := (getenv $.Site.Params.pack_version_env_var) }} 2 | {{ if not $pack_version }} 3 | {{ errorf "Unable to find 'pack_version': %s" $.Site.Params.pack_version_env_var }} 4 | {{ end }} 5 | 6 |
7 | 16 |
17 | {{ range $os := $.Site.Data.pack.install }} 18 | {{ $cssClasses := "" }} 19 | {{ if $os.default }} 20 | {{ $cssClasses = "active in show" }} 21 | {{ end }} 22 |
23 |
24 | 33 |
34 | {{ range $method := $os.methods }} 35 | {{ $cssClasses := "" }} 36 | {{ if $method.default }} 37 | {{ $cssClasses = "active in show" }} 38 | {{ end }} 39 |
40 | {{ $method.content | replaceRE "" $pack_version | markdownify }} 41 |
42 | {{ end }} 43 |
44 |
45 |
46 | {{ end }} 47 |
48 |
49 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/create-layer.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Create dependency layers" 3 | weight=3 4 | +++ 5 | 6 | Each directory created by the buildpack under the `CNB_LAYERS_DIR` can be used as a layer in the final app image or build cache. 7 | 8 | 9 | 10 | That is, each directory can be used for any of the following purposes: 11 | 12 | | Layer Type | | 13 | |------------|-------------------------------------------------------------------------------------------------------------| 14 | | `Launch` | the directory will be included in the **final app image** as a single layer | 15 | | `Cache` | the directory will be included in the **build cache** and restored to the `CNB_LAYERS_DIR` on future builds | 16 | | `Build` | the directory will be accessible to **buildpacks that follow** in the build (via the environment) | 17 | 18 | A buildpack can control how a layer will be used by creating a `.toml` with a name matching the directory it describes in the `CNB_LAYERS_DIR`. 19 | 20 | ### Example 21 | 22 | A buildpack might create a `$CNB_LAYERS_DIR/python` directory and a `$CNB_LAYERS_DIR/python.toml` with the following contents: 23 | 24 | ```toml 25 | launch = true 26 | cache = true 27 | build = true 28 | ``` 29 | 30 | In this example: 31 | 32 | * the final app image will contain a layer with `python`, as this is needed to run the app 33 | * the `$CNB_LAYERS_DIR/python` directory will be pre-created for future builds, avoiding the need to re-download this large dependency 34 | * buildpacks that follow in the build will be able to use `python` 35 | 36 | ### Example 37 | 38 | This is a simple `./bin/build` script for a buildpack that runs Python's `pip` package manager to resolve dependencies: 39 | 40 | ```bash 41 | #!/bin/sh 42 | 43 | PIP_LAYER="$CNB_LAYERS_DIR/pip" 44 | mkdir -p "$PIP_LAYER/modules" "$PIP_LAYER/env" 45 | 46 | pip install -r requirements.txt -t "$PIP_LAYER/modules" \ 47 | --install-option="--install-scripts=$PIP_LAYER/bin" \ 48 | --exists-action=w --disable-pip-version-check --no-cache-dir 49 | 50 | echo "launch = true" > "$PIP_LAYER.toml" 51 | ``` 52 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/concepts/component-buildpack.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="What is a component buildpack?" 3 | weight=99 4 | +++ 5 | 6 | A **component buildpack** is a buildpack containing `/bin/detect` and `/bin/build` executables and that implements the [Buildpack Interface](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-interface). 7 | 8 | 9 | 10 | ## Key Points 11 | 12 | During the `build` phase, typical component buildpacks might perform one, or more, of the following actions: 13 | 14 | * Read the [Buildpack Plan](https://buildpacks.io/docs/for-buildpack-authors/concepts/build-plan/) in `` to determine what dependencies to provide 15 | * Supply the application with [dependencies](https://buildpacks.io/docs/for-buildpack-authors/concepts/layer/) for launch in `/` 16 | * Reuse application [dependencies](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/re-use-layers/) from a previous image by appending `[types]` and `launch = true` to `/.toml` 17 | * Contribute [dependencies](https://buildpacks.io/docs/for-buildpack-authors/concepts/layer/) added in `/` to subsequent buildpacks 18 | * Reuse [cached build dependencies](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-layer/) from a previous build by appending `[types]`, `build = true` and `cache = true` to `/.toml` 19 | * Compile the application source code into object code 20 | * Remove application source code that is not necessary for launch 21 | * Supply start command in `/launch.toml` 22 | * Write a partial [Software Bill of Materials](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/add-sbom/) to `/.sbom.` describing any dependencies provided in the layer 23 | * Write a partial [Software Bill of Materials](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/add-sbom/) to `/launch.sbom.` describing any provided application dependencies not associated with a layer 24 | * Write a partial [Software Bill of Materials](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/add-sbom/) to `/build.sbom.` describing any provided build dependencies not associated with a layer 25 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/base-images.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Base image types" 3 | weight=99 4 | +++ 5 | 6 | As you already know, `Cloud Native Buildpacks (CNBs)` transform your application source code into `OCI images` that can run on any cloud. 7 | 8 | 9 | 10 | 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. 11 | 12 | ## Base image types 13 | 14 | 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. 15 | 16 | ### Build image 17 | 18 | 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. 19 | 20 | A typical `build image` might determine: 21 | 22 | * The OS distro in the build environment 23 | * OS packages installed in the build environment 24 | * Trusted CA certificates in the build environment 25 | * The default user in the build environment 26 | 27 | #### Anatomy of a build image 28 | 29 | Typically, a `build` image may include: 30 | 31 | * Shell 32 | * C-compiler 33 | * Minimal operating system distribution, such as Linux utilities that build systems might call out to 34 | * Build time libraries 35 | 36 | ### Runtime image 37 | 38 | A `runtime image` is an `OCI image` that serves as the base image for the final application image. 39 | 40 | A typical runtime image might determine: 41 | 42 | * The OS distro or distroless OS in the launch environment 43 | * OS packages installed in the launch environment 44 | * Trusted CA certificates in the launch environment 45 | * The default user in the run environment 46 | 47 | #### Anatomy of a runtime base image 48 | 49 | A `runtime` image may contain: 50 | 51 | * No-shell, unless it's needed by the application 52 | * Runtime libraries, such as Libfreetype 53 | * Runtime platforms, such as python interpreter, which are generally added by buildpacks 54 | 55 | For more details on `build` and `runtime` images, you can check out the [specification][spec] 56 | 57 | [spec]: https://github.com/buildpacks/spec/blob/main/platform.md#build-image 58 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/deprecated/platform-api-0.5-0.6.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Platform API 0.5 -> 0.6" 4 | aliases=[ 5 | "/docs/reference/spec/migration/platform-api-0.5-0.6" 6 | ] 7 | weight=3 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to platform operators. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.6) for Platform API 0.6 for the full list of changes and further details. 15 | 16 | ## Platform Operator 17 | 18 | ### Default process type not set if none is specified 19 | 20 | The `exporter` will no longer set the default process type if none is specified (even if there is only one process). Buildpacks implementing Buildpack API 0.6 or greater may set the default process type, or it may be specified by passing `-process-type` to the `exporter`. To enable buildpacks implementing older Buildpack APIs to work with newer buildpacks, the lifecycle will assume that buildpacks that implement Buildpack API less than 0.6 intended for `web` processes to be the default. 21 | 22 | ### New location for order.toml 23 | 24 | The `detector` will now look for `order.toml` in `` before checking other paths. This enables platforms to write `order.toml` into a mounted `` directory and override the builder's `order.toml` without knowing where it is saved on the builder. 25 | 26 | ### Image working directory is set to app directory 27 | 28 | The working directory on the exported image config will match the value of `CNB_APP_DIR`. This means that when running the image, processes started without the launcher will still use the app directory as the working directory. 29 | 30 | ### Condensed exit codes 31 | 32 | Lifecycle exit codes are condensed to be within 0-255 so that they are understandable when surfaced in Bash. Platforms should take note of the new values when interpreting exit codes returned by the lifecycle. See the [lifecycle][lifecycle] component pages for more information. 33 | 34 | ### Image manifest size in report.toml 35 | 36 | The report.toml output by the exporter will now include the image manifest size in bytes. Note that this only applies to published images, as images exported to a docker daemon will not have a manifest. 37 | 38 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 39 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/base-images/run.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Run image" 4 | aliases=[ 5 | "/docs/concepts/components/base-images/run" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | The **run image** provides the base image for application images. 11 | 12 | 13 | 14 | CNB tooling requires a reference to a run image and (where necessary) run image mirrors in order to construct the application image. 15 | 16 | ### Run image mirrors 17 | 18 | Run image mirrors provide alternate locations for `run images`, for use during `build` or `rebase`. 19 | 20 | When run image mirrors are defined, CNB tooling will try to find a run image that resides on the same registry as the application image, 21 | based on the image name provided. 22 | 23 | This is to reduce the amount of data transfer required to push the application image to a registry. 24 | 25 | #### Example - determining the registry 26 | 27 | If the application image name is: 28 | 29 | * `registry.example.com/example/app` - the registry is `registry.example.com` 30 | * `example/app` (registry omitted) - Docker Hub is assumed; the registry is `index.docker.io` 31 | 32 | #### Example - determining the run image mirror 33 | 34 | If your builder has a run image with mirrors defined as follows (see [how to create a builder](/docs/for-platform-operators/how-to/build-inputs/create-builder/builder) for more information): 35 | 36 | ```toml 37 | [[run.images]] 38 | image = "example/run" 39 | mirrors = ["registry.example.com/example/run"] 40 | ``` 41 | 42 | Then if you run `pack build` as follows: 43 | 44 | ```bash 45 | $ pack build registry.example.com/example/app 46 | ``` 47 | 48 | the selected run image will be `registry.example.com/example/run`. 49 | 50 | > For local development, it's often helpful to override the run image mirrors in a builder. 51 | > For this, the `pack config run-image-mirrors` command can be used. 52 | > This command does not modify the builder, and instead configures the local environment. 53 | > 54 | > To see what run images are configured for a builder, `pack builder inspect` can be used. 55 | > `pack builder inspect` will output built-in and locally-configured run images for a given builder, along with other useful information. 56 | > The order of the run images in the output denotes the order in which they will be matched during `build`. 57 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/concepts/base-images/stack.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Stack" 4 | aliases=[ 5 | "/docs/concepts/components/stack", 6 | "/docs/using-pack/stacks/" 7 | ] 8 | weight=99 9 | +++ 10 | 11 | A stack (deprecated) is the grouping together of the build and run base images, represented by a unique ID. 12 | 13 | 14 | 15 | As of Platform API 0.12 and Buildpack API 0.10, stacks are deprecated in favor of existing constructs in the container image ecosystem such as operating system name, operating system distribution, and architecture. 16 | 17 | For more information, see 18 | * Platform API 0.12 [migration guide](/docs/for-platform-operators/how-to/migrate/platform-api-0.11-0.12/) 19 | * Buildpack API 0.10 [migration guide](/docs/for-buildpack-authors/how-to/migrate/buildpack-api-0.9-0.10/) 20 | * [Build image](/docs/for-app-developers/concepts/base-images/build/) concept 21 | * [Run image](/docs/for-app-developers/concepts/base-images/run/) concept 22 | * [Target data](/docs/for-buildpack-authors/concepts/targets/) 23 | 24 | For older API versions, see below on using stacks. 25 | 26 | 27 | 28 | ## Using stacks 29 | 30 | > If you're using the `pack` CLI, running `pack stack suggest` will display a list of recommended 31 | stacks that can be used when running `pack builder create`, along with each stack's associated build and run images. 32 | 33 | Stacks are used by [builders][builder] and are configured through a builder's 34 | [configuration file](/docs/reference/config/builder-config/): 35 | 36 | ```toml 37 | [[buildpacks]] 38 | # ... 39 | 40 | [[order]] 41 | # ... 42 | 43 | [stack] 44 | id = "com.example.stack" 45 | build-image = "example/build" 46 | run-image = "example/run" 47 | run-image-mirrors = ["gcr.io/example/run", "registry.example.com/example/run"] 48 | ``` 49 | 50 | By providing the required `[stack]` section, a builder author can configure a stack's ID, build image, and run image 51 | (including any mirrors). 52 | 53 | ## Resources 54 | 55 | To learn how to create your own stack, see our [Operator's Guide][operator-guide]. 56 | 57 | [operator-guide]: /docs/for-platform-operators/ 58 | [builder]: /docs/for-platform-operators/concepts/builder/ 59 | [buildpack]: /docs/for-platform-operators/concepts/buildpack/ 60 | [lifecycle]: /docs/for-platform-operators/concepts/lifecycle/ 61 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-outputs/understand-failures.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Understand build failures" 3 | weight=99 4 | summary="How to troubleshoot when things go wrong." 5 | +++ 6 | 7 | While `Buildpacks` help developers transform source code into container images that can run on any cloud, creating an error-free experience remains far from achieved. 8 | 9 | This guide catalogs some commonly reported issues that may prevent image build completion and provides troubleshooting tips to help end-users navigate these issues. 10 | 11 | If you would like to report an issue, please open a PR against this page using the included template (see bottom of page in Markdown). 12 | 13 | #### Issue: `ERROR: failed to build: failed to fetch base layers: saving image with ID "sha256:" from the docker daemon: Error response from daemon: unable to create manifests file: NotFound: content digest sha256:: not found` 14 | 15 | **Occurs when**: building and saving to a docker daemon 16 | **Analysis**: this seems to indicate a problem with the underlying image store in `Docker` 17 | **Remediation**: remove existing images with `docker image prune` (potentially, from multiple storage drivers if switching between `overlay2` and `containerd`) 18 | **Related error messages**: 19 | 20 | * `ERROR: failed to initialize analyzer: getting previous image: get history for image "test": Error response from daemon: NotFound: snapshot sha256: does not exist: not found` 21 | * `ERROR: failed to export: saving image: failed to fetch base layers: open /tmp/imgutil.local.image./blobs/sha256/: no such file or directory` 22 | 23 | **For more information**: 24 | 25 | * [Issue link on GitHub](https://github.com/buildpacks/pack/issues/2270) 26 | * [Slack thread](https://cloud-native.slack.com/archives/C0331B61A1Y/p1717422902392339?thread_ts=1717185700.984459&cid=C0331B61A1Y) 27 | * [Another Slack thread](https://cloud-native.slack.com/archives/C033DV8D9FB/p1730243369203799) 28 | 29 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/deprecated/platform-api-0.3-0.4.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Platform API 0.3 -> 0.4" 4 | aliases=[ 5 | "/docs/reference/spec/migration/platform-api-0.3-0.4" 6 | ] 7 | weight=1 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to platform operators. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.4) for Platform API 0.4 for the full list of changes and further details. 15 | 16 | ### Windows support 17 | 18 | Windows image builds are now supported! See the [Windows build guide](/docs/for-app-developers/how-to/special-cases/build-for-windows) 19 | for more details. 20 | 21 | ### Multicall launcher 22 | 23 | When running the exported application image, it is now possible to provide arguments to pre-defined process types. 24 | The new flow is described [here](/docs/for-app-developers/how-to/build-outputs/specify-launch-process/#run-a-multi-process-app). 25 | As part of these changes, the exporter will not set, and the launcher no longer accepts, the `CNB_PROCESS_TYPE` variable. 26 | See the associated [RFC](https://github.com/buildpacks/rfcs/blob/main/text/0045-launcher-arguments.md) and [spec PR](https://github.com/buildpacks/spec/pull/118) 27 | for more details. 28 | 29 | ### Export & rebase report 30 | 31 | The exporter and rebaser now produce a [report.toml](https://github.com/buildpacks/spec/pull/113) containing the identifier of the application image. 32 | When building, platforms can optionally specify the location of the report, or save it off somewhere. 33 | 34 | ### Removal of top-level `version` from `BOM` 35 | 36 | When interpreting the Bill-of-Materials (BOM), `version` [will no longer be found at the top level](https://github.com/buildpacks/spec/pull/117). 37 | The lifecycle will convert any `version` provided by buildpacks to `metadata.version`. 38 | Related: as of Buildpack API 0.3, `version` is [deprecated](https://github.com/buildpacks/spec/pull/97) as a top-level key in the build plan. 39 | 40 | ### New exit code definition 41 | 42 | The lifecycle now defines [specific error codes](https://github.com/buildpacks/spec/pull/115) to signal the lifecycle phase where the error occurred, and for API incompatibilities. 43 | When building, the new error codes can be interpreted according to the new definition. 44 | This is particularly helpful when using the `creator`. 45 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Releases 2 | 3 | This repository automatically deploys any changes made to the `main` branch. 4 | 5 | ## Lump Changes 6 | 7 | In the event, that you'd like to stage changes to be released together (aka lump) we suggest the following process. 8 | 9 | Some use cases in which this may be desired... 10 | 11 | 1. A new version of `pack` may require some options in our guides to change and we'd like to coordinate the docs changes with the release of the new version. 12 | 2. A spec change may require a migration guide, some guides to change, and/or a new guide altogether. We want to update the docs all in one swoop. 13 | 14 | 15 | ### Process 16 | 17 | 1. A milestone in the following format is created: `/` * 18 | 1. Issues are created and tagged with appropriate milestone. 19 | 1. A release branch in the following format is created off of `main`: `release//` * 20 | 1. As changes are completed, PRs would target the release branch and merged using the same guidelines as merging to `main`. 21 | 1. Once all issues and/or the associated component release is shipped, the release branch is merged into `main` by sub-team maintainers. 22 | 23 | _* may require a [project contributor or maintainer](https://github.com/buildpacks/community/blob/main/TEAMS.md) intervention._ 24 | 25 | 26 | ##### Example Naming 27 | 28 | Branches: 29 | 30 | - `release/pack/1.2.3` 31 | - `release/spec/buildpack/0.9` 32 | - `release/spec/extension/bindings/0.3` 33 | - `release/tekton/task/buildpacks/0.5` 34 | 35 | Milestones: 36 | 37 | - `pack/1.2.3` 38 | - `spec/buildpack/0.9` 39 | - `spec/extension/bindings/0.3` 40 | - `tekton/task/buildpacks/0.5` 41 | 42 | 43 | ##### Example Workflow 44 | 45 | Let's imagine `pack` is releasing version `1.2.3`. It is known that there will be a decent amount of changes to a few guides and we'd like to separate the entire set of changes per guide. The steps that would be taken are as follows: 46 | 47 | 1. A milestone `pack/1.2.3` would be created. 48 | 1. Issues for the necessary changes would be tagged with milestone `pack/1.2.3`. 49 | 1. A release branch `release/pack/1.2.3` would be created. 50 | 1. As changes are completed, PRs would target `release/pack/1.2.3` and merged. 51 | 1. Once all issues and/or release of `pack` version `1.2.3` is shipped, the `release/pack/1.2.3` branch would be merged into `main`. 52 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/basic-extension/03_building-blocks-extension.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="The building blocks of a CNB image extension" 4 | aliases=[ 5 | "/docs/extension-author-guide/building-blocks-extension/", 6 | "/docs/extension-guide/create-extension/building-blocks-extension" 7 | ] 8 | weight=3 9 | +++ 10 | 11 | 12 | 13 | 14 | 15 | ### Examine `vim` extension 16 | 17 | ```bash 18 | tree $PWD/samples/extensions/vim 19 | ``` 20 | 21 | You should see something akin to the following: 22 | 23 | ``` 24 | . 25 | ├── bin 26 | │ ├── detect <- similar to a buildpack ./bin/detect 27 | │ ├── generate <- similar to a buildpack ./bin/build 28 | ├── extension.toml <- similar to a buildpack buildpack.toml 29 | ``` 30 | 31 | * The `extension.toml` describes the extension, containing information such as its name, ID, and version, as well as the 32 | Buildpack API that it implements. Though extensions are not buildpacks, they are expected to conform to the Buildpack 33 | API except where noted. Consult the [spec](https://github.com/buildpacks/spec/blob/main/image_extension.md) 34 | for further details. 35 | * `./bin/detect` is invoked during the `detect` phase. It analyzes application source code to determine if the extension 36 | is needed and contributes [build plan] entries (much like a 37 | buildpack `./bin/detect`). Just like for buildpacks, a `./bin/detect` that exits with code `0` is considered to have 38 | passed detection, and fails otherwise. 39 | * `./bin/generate` is invoked during the `generate` phase (a new lifecycle phase that happens after `detect`). It 40 | outputs either or both of `build.Dockerfile` or `run.Dockerfile` for extending the builder or run image, respectively. 41 | * Only a limited set of Dockerfile instructions is supported - consult 42 | the [spec](https://github.com/buildpacks/spec/blob/main/image_extension.md) 43 | for further details. 44 | 45 | We'll take a closer look at the executables for the `vim` extension in the next step. 46 | For guidance around writing extensions and more advanced use cases, see [here](/docs/for-buildpack-authors/how-to/write-extensions). 47 | 48 | 49 | --- 50 | 51 | Next Step 52 | 53 | 54 | [build plan]: /docs/for-buildpack-authors/how-to/write-buildpacks/use-build-plan 55 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/deprecated/platform-api-0.4-0.5.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Platform API 0.4 -> 0.5" 4 | aliases=[ 5 | "/docs/reference/spec/migration/platform-api-0.4-0.5" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to platform operators and stack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.5) for Platform API 0.5 for the full list of changes and further details. 15 | 16 | ## Platform Operator 17 | 18 | ### `PATH` must be set on stack images 19 | 20 | `config.Env.PATH` must be set for stack (build and run) images. Any Linux or Windows stack image missing a `config.Env.PATH` should cause the platform to fail with an error message. 21 | 22 | ### Homepage in build metadata 23 | 24 | The exporter now adds buildpack homepage to the `io.buildpacks.build.metadata` label on the application image. Platforms may inspect this label to display buildpack information to the user. 25 | 26 | ### Build-time `BOM` 27 | 28 | The exporter now writes a build-time Bill-of-Materials (BOM) to `report.toml`. When building, platforms can optionally specify the location of the report, or save it off somewhere. 29 | 30 | ### Default paths for TOML files 31 | 32 | All default file paths that were previously relative to the working directory are relative to the layers directory: `analyzed.toml`, `group.toml`, `plan.toml`, `project-metadata.toml`, and `report.toml`. When building, if the layers directory is set to something other than the default `/layers`, these files will be written to the specified layers directory and not `/layers`. 33 | 34 | ## Stack Author 35 | 36 | ### `PATH` must be set on stack images 37 | 38 | `config.Env.PATH` must be set for stack (build and run) images. This is the current de-facto Linux behavior. When creating stack images, Windows stack authors must take action to set this variable in the image config - e.g., if using a Dockerfile: `ENV PATH C:\\Windows\\System32` or `ENV PATH C:\\Windows\\System32;C:\\stack-specific-dir`. 39 | 40 | ### Stack image metadata 41 | 42 | When creating stack images, the following labels may be added to additionally describe the image: 43 | * `io.buildpacks.stack.maintainer` 44 | * `io.buildpacks.stack.homepage` 45 | * `io.buildpacks.stack.distro.name` 46 | * `io.buildpacks.stack.distro.version` 47 | * `io.buildpacks.stack.released` 48 | * `io.buildpacks.stack.description` 49 | * `io.buildpacks.stack.metadata` 50 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/migrate/platform-api-0.8-0.9.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Platform API 0.8 -> 0.9" 4 | aliases=[ 5 | "/docs/reference/spec/migration/platform-api-0.8-0.9" 6 | ] 7 | weight=2 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to platform operators. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.9) for Platform API 0.9 for the full list of changes and further details. 15 | 16 | ## Platform Operator 17 | 18 | ### Legacy BOM information removed from `io.buildpacks.build.metadata` label 19 | 20 | Legacy BOM information is removed from the `io.buildpacks.build.metadata` label and `/config/metadata.toml`. Buildpacks may still output BOM information in the legacy format, and it can now be found in `/sbom/launch/sbom.legacy.json` (for runtime dependencies) or `/sbom/build/sbom.legacy.json` (for build time dependencies). Note that `/sbom/build/sbom.legacy.json` is not exported in the application image, and must be copied from the build container before it exits. 21 | 22 | ### Configurable image create time 23 | 24 | Platforms can set `SOURCE_DATE_EPOCH` in the exporter's environment to configure the create time of the exported application image. For example, platforms can set `SOURCE_DATE_EPOCH=$(date +%s)` to give images a meaningful create time instead of the current hard coded value of January 1, 1980. Note that changing the create time for an image will change its digest, affecting build reproducibility. For more information on build reproducibility, see our [blog post](https://medium.com/buildpacks/time-travel-with-pack-e0efd8bf05db). 25 | 26 | ### New analyzer flags 27 | 28 | The analyze phase accepts a `-launch-cache` flag, improving performance when restoring the SBOM layer from the previous image in a Docker daemon. This should save several seconds of build time when using a Docker daemon and the untrusted builder workflow. Additionally, the analyzer accepts a `-skip-layers` flag to completely skip SBOM layer restoration instead of merely omitting SBOM files from buildpack layer directories when skipping the `restore` phase. 29 | 30 | ### Process-specific working directory 31 | 32 | As of Buildpack API 0.8, buildpacks can specify the working directory for a process. If a working directory has been specified, this information will be included in the `io.buildpacks.build.metadata` label so that platforms can display this information to end users. 33 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/analyze.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Analyze" 3 | aliases=[ 4 | "/docs/concepts/components/lifecycle/analyze" 5 | ] 6 | weight=1 7 | +++ 8 | 9 | The `analyzer` restores files that buildpacks may use to optimize the `build` and `export` phases. 10 | 11 | 12 | 13 | Prior to `Platform API 0.7`, the `analyzer` was responsible for analyzing the metadata from the cache and the previously built image, if available, to determine what layers can or cannot be reused. 14 | This information is used during the `export` phase in order to avoid re-uploading unchanged layers.\ 15 | 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`.\ 16 | For more information, please see [this migration guide][platform-api-06-07-migration]. 17 | 18 | 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. 19 | 20 | The `lifecycle` must write [analysis metadata][analyzedtoml-toml] to ``, where: 21 | 22 | - `image` MUST describe the ``, if accessible 23 | - `run-image` MUST describe the `` 24 | 25 | ### Exit Codes 26 | 27 | If the `analyze` phase was successful or there was any error during the process, the output will have one of the following exit codes: 28 | 29 | | Exit Code | Result | 30 | |-----------------|-------------------------------------| 31 | | `0` | Success | 32 | | `11` | Platform API incompatibility error | 33 | | `12` | Buildpack API incompatibility error | 34 | | `1-10`, `13-19` | Generic lifecycle errors | 35 | | `30-39` | Analysis-specific lifecycle errors | 36 | 37 | *** 38 | 39 | For more information about the `analyzer`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#analyzer). 40 | 41 | [platform-api-06-07-migration]: https://buildpacks.io/docs/for-platform-operators/how-to/migrate/deprecated/platform-api-0.6-0.7/ 42 | [analyzedtoml-toml]: https://github.com/buildpacks/spec/blob/main/platform.md#analyzedtoml-toml 43 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/distribute-buildpacks/publish-buildpack/_index.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Publish a buildpack" 4 | aliases=[ 5 | "/docs/buildpack-author-guide/publish-a-buildpack" 6 | ] 7 | weight=5 8 | +++ 9 | 10 | Learn how to publish your buildpack to the Buildpack Registry. 11 | 12 | 13 | 14 | ### 0. Packaging your buildpack 15 | 16 | Make sure you've followed the steps in [Package a buildpack][package] to create your buildpack image and publish it to an OCI registry. 17 | 18 | **NOTE:** In order to publish your buildpack to the registry, its `id` must be in the format `/`. For example: 19 | 20 | ```toml 21 | [buildpack] 22 | id = "example/my-cnb" 23 | ``` 24 | 25 | ### 1. Register your buildpack 26 | 27 | With your buildpack image published to a public OCI registry, you can now run the following command to register that buildpack with the Buildpack Registry (but you must replace `example/my-cnb` with your _image_ name): 28 | 29 | ```shell script 30 | pack buildpack register example/my-cnb 31 | ``` 32 | 33 | This will open GitHub in a browser and may ask you to authenticate with GitHub. After doing so, you'll see a pre-populated GitHub Issue with the details of your buildpack. For example: 34 | 35 | pre-populated GitHub Issue 36 | 37 | The pre-populated text in the body of the issue is considered structured data, and will be used to automatically add the buildpack to the registry index. Do not change it. 38 | 39 | Click _Submit new issue_, and your request will be processed within seconds. If the image is a valid buildpack, it will be added to the registry. If there is a problem, the issue will be tagged as a "Failure" and a comment will be added with a link to get more details. Whether successful or not, the issue will be closed. 40 | 41 | > **Managing your namespace** 42 | > 43 | > The first time you publish a buildpack with a given namespace, the registry will automatically assign your GitHub user as that namespace's owner. From then on, only you can publish new buildpacks or buildpack versions under that namespace. 44 | > 45 | > If you try to publish a buildpack with a namespace that's already in use, the request will fail and the GitHub issue will be closed. You can add or change namespace owners by submitting a Pull Request to the [buildpacks/registry-namespaces](https://github.com/buildpacks/registry-namespaces/). 46 | 47 | [package]: /docs/for-buildpack-authors/how-to/distribute-buildpacks/package-buildpack 48 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/integrate-ci/pack/_index.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Pack" 4 | aliases=[ 5 | "/docs/install-pack/", 6 | "/docs/tools/pack/", 7 | "/docs/tools/pack/cli/install/" 8 | ] 9 | weight=1 10 | +++ 11 | 12 | Pack is a CLI tool maintained by the CNB project to support the use of buildpacks. 13 | 14 | 15 | 16 | It enables the following functionality: 17 | 18 | 1. [`build`][build] an application using buildpacks. 19 | 1. [`rebase`][rebase] application images created using buildpacks. 20 | 1. Creation of various [components][components] used within the ecosystem. 21 | 22 | Pack works as both a [Command Line Interface (CLI)](#pack-cli) and a [Go library](#go-library). 23 | 24 | --- 25 | 26 | ## `pack` CLI 27 | 28 | ### Install 29 | 30 | You can install the most recent version of the `pack` CLI (version **{{< pack-version >}}**) on the following operating systems: 31 | 32 | {{< pack-install >}} 33 | 34 | #### RCs 35 | Prior to publishing releases, we publish RC (release candidate) builds of `pack`. You can install those by downloading the releases from the [releases page on GitHub][github-releases]. 36 | 37 | #### Auto-completion 38 | 39 | `pack` supports shell completions for the following shells - 40 | 41 | * `bash` 42 | * `fish` 43 | * `zsh` 44 | 45 | To configure your `bash` shell to load completions for each session, add the following to your `.bashrc` or `.bash_profile`: 46 | 47 | ```bash 48 | . $(pack completion) 49 | ``` 50 | 51 | To configure your `fish` shell to load completions for each session, add the following to your `~/.config/fish/config.fish`: 52 | 53 | ```bash 54 | source (pack completion --shell fish) 55 | ``` 56 | 57 | To configure your `zsh` shell to load completions for each session, add the following to your `.zshrc`: 58 | 59 | ```bash 60 | . $(pack completion --shell zsh) 61 | ``` 62 | 63 | ### References 64 | 65 | - [Docs](/docs/for-platform-operators/how-to/integrate-ci/pack/cli/pack/) 66 | - [Source](https://github.com/buildpacks/pack/) 67 | 68 | --- 69 | 70 | ## Go library 71 | 72 | ### Install 73 | 74 | ```shell 75 | go get -u github.com/buildpacks/pack 76 | ``` 77 | 78 | ### References 79 | 80 | - [Docs](https://pkg.go.dev/github.com/buildpacks/pack) 81 | - [Source](https://github.com/buildpacks/pack/) 82 | 83 | [build]: /docs/for-app-developers/concepts/build/ 84 | [rebase]: /docs/for-app-developers/concepts/rebase/ 85 | [components]: /docs/for-platform-operators/concepts/ 86 | [github-releases]: https://github.com/buildpacks/pack/releases 87 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Create a build base image" 4 | aliases=[ 5 | "/docs/operator-guide/create-build-base" 6 | ] 7 | weight=1 8 | +++ 9 | 10 | The build-time base image provides the OS-level dependencies for buildpacks at build-time. 11 | 12 | 13 | 14 | ## Define a build base image for your CNB build 15 | 16 | We need a Dockerfile similar to the following: 17 | 18 | ```Dockerfile 19 | # Define the base image 20 | FROM ubuntu:noble 21 | 22 | # Install packages that we want to make available at build time 23 | RUN apt-get update && \ 24 | apt-get install -y xz-utils ca-certificates && \ 25 | rm -rf /var/lib/apt/lists/* 26 | 27 | # Set required CNB user information 28 | ARG cnb_uid=1000 29 | ARG cnb_gid=1000 30 | ENV CNB_USER_ID=${cnb_uid} 31 | ENV CNB_GROUP_ID=${cnb_gid} 32 | 33 | # Create user and group 34 | RUN groupadd cnb --gid ${CNB_GROUP_ID} && \ 35 | useradd --uid ${CNB_USER_ID} --gid ${CNB_GROUP_ID} -m -s /bin/bash cnb 36 | 37 | # Set user and group 38 | USER ${CNB_USER_ID}:${CNB_GROUP_ID} 39 | 40 | # Set required CNB target information 41 | LABEL io.buildpacks.base.distro.name="your distro name" 42 | LABEL io.buildpacks.base.distro.version="your distro version" 43 | ``` 44 | 45 | ### Define the base image 46 | 47 | We start with `ubuntu:noble` as our base image. 48 | You can use any operating system, operating system distribution, and operating system distribution version of your choosing, 49 | as long as they are supported by the available buildpacks. 50 | 51 | ### Install packages that we want to make available at build time 52 | 53 | Install any system packages that your buildpacks will need. 54 | 55 | ### Set required CNB user information 56 | 57 | We need to define `CNB_USER_ID` and `CNB_GROUP_ID` in the environment so that the lifecycle can run as the correct user. 58 | 59 | ### Create user and group, set user and group 60 | 61 | The `USER` in the image config must match the user indicated by `CNB_USER_ID` and `CNB_GROUP_ID`. 62 | 63 | The given user **MUST NOT** be a root user, and must have a writeable home directory. 64 | 65 | ### Set required CNB target information 66 | 67 | Finally, we need to label the image with operating system distribution information for platforms and the lifecycle to use. 68 | 69 | To determine which values to provide, see [targets](/docs/for-buildpack-authors/concepts/targets/) concept information. 70 | 71 | ## Build the build base image 72 | 73 | ```bash 74 | docker build . -t cnbs/sample-base-build:noble 75 | ``` 76 | -------------------------------------------------------------------------------- /content/docs/for-platform-operators/concepts/lifecycle/extend.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Extend" 3 | weight=9 4 | +++ 5 | 6 | The `extender` applies `Dockerfiles` output by image extensions to the `build` or `runtime` base image. 7 | 8 | 9 | 10 | ### Exit Codes 11 | 12 | When extending the build image: 13 | 14 | - In addition to the outputs enumerated below, outputs produced by `extender` include those produced by `builder` - as the `lifecycle` will run the `build` phase after extending the `build image`. 15 | - Platforms MUST skip the `builder` and proceed to the `exporter`. 16 | 17 | | Exit Code | Result | 18 | |-----------------|-------------------------------------| 19 | | `0` | Success | 20 | | `11` | Platform API incompatibility error | 21 | | `12` | Buildpack API incompatibility error | 22 | | `1-10`, `13-19` | Generic lifecycle errors | 23 | | `100-109` | Extension-specific lifecycle errors | 24 | 25 | - For each extension in `` in order, if a `Dockerfile` exists in `//.Dockerfile`, the `lifecycle`: 26 | - Shall apply the `Dockerfile` to the environment according to the process outlined in the [Image Extension Specification](https://github.com/buildpacks/spec/blob/main/image_extension.md). 27 | - SHALL set the build context to the folder according to the process outlined in the [Image Extension Specification](https://github.com/buildpacks/spec/blob/main/image_extension.md). 28 | - The extended image must be an extension of: 29 | - The `build-image` in `` when `` is `build`, or 30 | - The `run-image` in `` when `` is `run` 31 | - When extending the `build image`, after all `build.Dockerfile`s are applied, the `lifecycle`: 32 | - Shall proceed with the `build` phase using the provided `` and `` 33 | - When extending the run image, after all `run.Dockerfile`s are applied, the `lifecycle`: 34 | - **If** any `run.Dockerfile` set the label `io.buildpacks.rebasable` to `false` or left the label unset: 35 | - Shall set the label `io.buildpacks.rebasable` to `false` on the extended run image 36 | - **If** after the final `run.Dockerfile` the run image user is `root`, 37 | - Shall fail 38 | - Shall copy the manifest and config for the extended run image, along with any new layers, to ``/run 39 | 40 | *** 41 | 42 | For more information about the `extender`, see the [Platform API spec](https://github.com/buildpacks/spec/blob/main/platform.md#extender-optional). 43 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/deprecated/buildpack-api-0.6-0.7.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Buildpack API 0.6 -> 0.7" 4 | aliases=[ 5 | "/docs/reference/spec/migration/buildpack-api-0.6-0.7" 6 | ] 7 | weight=3 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to buildpack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.7) for Buildpack API 0.7 for the full list of changes and further details. 15 | 16 | ### New standardized SBOM format 17 | 18 | Buildpacks may write Software Bill of Materials (SBOM) files describing build- or run-time dependencies. These files must use the `application/vnd.cyclonedx+json`, `application/spdx+json`, or `application/vnd.syft+json` media types (a buildpack may output SBOM files in multiple formats). Files may be written to the following locations: 19 | 20 | * `/.sbom.` - for describing dependencies associated with a layer 21 | * Example (launch layer): libraries that were included in an output compiled binary (e.g., `go` libraries in a `go` binary) 22 | * Example (build layer): tools like a package manager 23 | * `/launch.sbom.` - for describing run-time dependencies not associated with a layer 24 | * Example: dependencies installed in the `/workspace` directory 25 | * `/build.sbom.` - for describing build-time dependencies not associated with a layer 26 | * Example: build time configuration 27 | 28 | Valid `` extensions are as follows: 29 | | SBOM Media Type | File Extension 30 | |----------------------------------|---------------------------------------------- 31 | | `application/vnd.cyclonedx+json` | `cdx.json` 32 | | `application/spdx+json` | `spdx.json` 33 | | `application/vnd.syft+json` | `syft.json` 34 | 35 | SBOM files for launch will be included in the application image if the platform api supports it; SBOM files for build may be saved off by the platform prior to the build container exiting. 36 | 37 | Layer-associated SBOM files will be cached and restored to the buildpack layers directory on re-builds of the same image (much like the `/.toml` metadata file). `/launch.sbom.` and `/build.sbom.` must be re-created on each build. 38 | 39 | The `[bom]` tables in launch.toml and build.toml are deprecated, but remain supported to enable backwards compatibility with platforms implementing Platform API < 0.8. 40 | 41 | ### New fields in buildpack descriptor 42 | 43 | * A `sbom-formats` array indicating the SBOM formats output by the buildpack. 44 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/add-labels.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Add labels to the application image" 3 | weight=99 4 | +++ 5 | 6 | Labels are key-value pairs, stored as strings, that are attached to an image (i.e., arbitrary metadata). Labels are used to add helpful descriptions or attributes to an application image, which are meaningful to users. 7 | 8 | 9 | 10 | Labels are usually added at the time an image is created. Images can have multiple labels; however, each key must be unique. 11 | 12 | ## Key Points 13 | 14 | A `LABEL` 15 | 16 | * MUST specify a unique key for a given image 17 | * MUST specify a value to be set in the image label 18 | * MUST be added as an image label on the created image metadata 19 | * If one key is given multiple values, the last value overwrites 20 | 21 | ## Use Cases 22 | 23 | Since adding labels to application images is optional and not needed to run containers, this property is often overlooked. The following are few reasons to why labels should be widely adopted 24 | 25 | * Documenting versioning 26 | * Record licensing information 27 | * Including information about a project maintainer 28 | * Including a description of the image and additional metadata related to the image 29 | * Labels can also be used to organize images 30 | 31 | ## Implementation Steps 32 | 33 | Taking the perspective of a buildpack author, labels are added to the `launch.toml` file in the `/` directory as follows: 34 | 35 | ```toml 36 | [[labels]] 37 | key1 = "key1-string" 38 | value1 = "value1-string" 39 | 40 | [[labels]] 41 | key2 = "key2-string" 42 | value2 = "value2-string" 43 | ``` 44 | 45 | Going back to the example in the [Buildpack Author's Guide](/docs/for-buildpack-authors/tutorials/basic-buildpack/01_setup-local-environment), this means writing to`"${CNB_LAYERS_DIR}"/node-js/launch.toml`. 46 | 47 | ### Examples 48 | 49 | A `shell` example looks as follows: 50 | 51 | ```shell 52 | cat << EOF > "${CNB_LAYERS_DIR}"/node-js/launch.toml 53 | [[labels]] 54 | key = "key" 55 | value = "value" 56 | EOF 57 | ``` 58 | 59 | While a `Go` example would set the `Labels` field in a `libcnb.BuildResult` as returned by the `build` binary: 60 | 61 | ```Go 62 | func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { 63 | result := libcnb.BuildResult{} 64 | 65 | result.Labels = append(result.Labels, libcnb.Label{Key: "key", Value: "value"}) 66 | 67 | return result 68 | } 69 | ``` 70 | 71 | The `libcnb` library will automatically take care of writing the `launch.toml` file to the right place. 72 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/migrate/buildpack-api-0.9-0.10.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Buildpack API 0.9 -> 0.10" 4 | aliases=[ 5 | "/docs/reference/spec/migration/buildpack-api-0.9-0.10" 6 | ] 7 | weight=6 8 | +++ 9 | 10 | 11 | 12 | This guide is most relevant to buildpack authors. 13 | 14 | See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.10) for Buildpack API 0.10 for the full list of changes and further details. 15 | 16 | ### Stacks are deprecated 17 | 18 | In Buildpack 0.10, the concepts of stacks and mixins are removed 19 | in favor of existing constructs in the container image ecosystem such as operating system name, operating system distribution, and architecture. 20 | 21 | #### Before build 22 | 23 | `builder.toml` contains a new table for buildpacks to express the os/arch combinations that they are compatible with: 24 | 25 | ```toml 26 | [[targets]] 27 | os = "" 28 | arch = "" 29 | variant = "" 30 | [[targets.distros]] 31 | name = "" 32 | version = "" 33 | ``` 34 | 35 | All fields are optional and any missing field is assumed to "match any". 36 | 37 | This information will be used by the lifecycle to skip running detect on any buildpack that is not compatible with the current os/arch. 38 | 39 | Note that the `[[stacks]]` table is still supported and buildpack authors are encouraged to continue to provide this information for the time being 40 | in order to maintain compatibility with older platforms. 41 | 42 | #### During build 43 | 44 | The lifecycle will provide the following environment variables during `detect` and `build` to describe the target os/arch: 45 | 46 | | Env Variable | Description | 47 | |-----------------------------|-------------------------------------------| 48 | | `CNB_TARGET_OS` | Target OS | 49 | | `CNB_TARGET_ARCH` | Target architecture | 50 | | `CNB_TARGET_ARCH_VARIANT` | Target architecture variant (optional) | 51 | | `CNB_TARGET_DISTRO_NAME` | Target OS distribution name (optional) | 52 | | `CNB_TARGET_DISTRO_VERISON` | Target OS distribution version (optional) | 53 | 54 | Buildpacks can use this information to modify their behavior depending on the target. 55 | 56 | ### Run image extensions is supported (experimental) 57 | 58 | In Platform 0.12, extensions can be used to extend not only build-time base images, but runtime base images as well. 59 | 60 | For more information, see [authoring an image extension](/docs/for-buildpack-authors/tutorials/basic-extension). 61 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/add-sbom.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Provide a Software Bill-of-Materials" 3 | weight=5 4 | +++ 5 | 6 | Buildpacks can provide a [Software `Bill-of-Materials`](https://en.wikipedia.org/wiki/Software_bill_of_materials) (SBOM) 7 | to describe the dependencies that they provide. 8 | 9 | 10 | 11 | There are three supported ways to report SBOM data. 12 | You'll need to choose to use one or more of [CycloneDX](https://cyclonedx.org/), [SPDX](https://spdx.dev/) or [Syft](https://github.com/anchore/syft). 13 | The SBOM format you choose to use is likely to be the format accepted by the SBOM scanner (eg: [`syft cli`](https://github.com/anchore/syft)) you might choose to use. 14 | 15 | The emitted SBOM files follow a naming convention based on the layer they describe and the format they contain. 16 | 17 | For example, to provide SBOM information in CycloneDX json format for a `node-js` layer, 18 | you'll need to create a `node-js.sbom.cdx.json` file in the buildpack layers directory containing the SBOM data. 19 | 20 | Other supported file extensions are `spdx.json` or `syft.json`. 21 | 22 | You'll also need to update your `buildpack.toml` file to declare that your buildpack emits SBOM files. For example: 23 | 24 | 25 | ```toml 26 | # Buildpack API version 27 | api = "0.10" 28 | 29 | # Buildpack ID and metadata 30 | [buildpack] 31 | id = "examples/node-js" 32 | version = "0.0.1" 33 | sbom-formats = [ "application/vnd.cyclonedx+json" ] 34 | ``` 35 | 36 | Then, in our buildpack implementation we will generate the necessary SBOM metadata: 37 | 38 | ```bash 39 | # ... 40 | 41 | # Append a Bill-of-Materials containing metadata about the provided node-js version 42 | cat >> "${CNB_LAYERS_DIR}/node-js.sbom.cdx.json" << EOL 43 | { 44 | "bomFormat": "CycloneDX", 45 | "specVersion": "1.4", 46 | "version": 1, 47 | "components": [ 48 | { 49 | "type": "library", 50 | "name": "node-js", 51 | "version": "${node_js_version}" 52 | } 53 | ] 54 | } 55 | EOL 56 | ``` 57 | 58 | We can also add an SBOM entry for each dependency listed in `package.json`. Here we use `jq` to add a new record to the `components` array in `bundler.sbom.cdx.json`: 59 | 60 | ```bash 61 | node-jsbom="${CNB_LAYERS_DIR}/node-js.sbom.cdx.json" 62 | cat >> ${node-jsbom} << EOL 63 | { 64 | "bomFormat": "CycloneDX", 65 | "specVersion": "1.4", 66 | "version": 1, 67 | "components": [ 68 | { 69 | "type": "library", 70 | "name": "node-js", 71 | "version": "${node_js_version}" 72 | } 73 | ] 74 | } 75 | EOL 76 | ``` 77 | 78 | The bill-of-materials information will be available using `pack sbom download`. 79 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/special-cases/build-for-arm.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Build for ARM architecture" 4 | aliases=[ 5 | "/docs/app-developer-guide/build-an-arm-app" 6 | ] 7 | weight=1 8 | +++ 9 | 10 | 11 | 12 | Building for the ARM architecture is now easier than ever! The `heroku/builder:24` builder supports both AMD64 and ARM64 architectures, and includes 13 | 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]. 14 | 15 | > **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. 16 | 17 | ### 1. Clone the [samples][samples] repository 18 | 19 | ``` 20 | # clone the repo 21 | git clone https://github.com/buildpacks/samples 22 | ``` 23 | 24 | 25 | ### 2. Build the app 26 | 27 | If you're using an ARM64 computer (such as an Apple Silicon Mac, or an AWS Graviton instance), you can build an ARM64 OCI image with [pack][pack] simply by setting your builder to `heroku/builder:24`: 28 | ``` 29 | pack build java-maven-sample --path samples/apps/java-maven/ --builder heroku/builder:24 30 | ``` 31 | 32 | 33 | By default, `pack` uses the current architecture for multi-arch builders like `heroku/builder:24`, so an AMD64 image will be built on AMD64 systems. 34 | 35 | If you want to build an ARM64 image from a different host architecture, use the `--platform` parameter: 36 | ``` 37 | pack build java-maven-sample --path samples/apps/java-maven/ --builder heroku/builder:24 --platform linux/arm64 38 | ``` 39 | 40 | 41 | > **TIP:** If you don't want to keep specifying a builder every time you build, you can set it as your default 42 | > builder by running `pack config default-builder ` for example `pack config default-builder heroku/builder:24` 43 | 44 | 45 | ### 3. Run it 46 | 47 | ``` 48 | docker run --rm -p 8080:8080 java-maven-sample 49 | ``` 50 | 51 | 52 | **Congratulations!** 53 | 54 | 55 | The app should now be running and accessible via [localhost:8080](http://localhost:8080). 56 | 57 | 58 | [pack]: https://github.com/buildpacks/pack 59 | [docker]: https://docs.docker.com 60 | [samples]: https://github.com/buildpacks/samples 61 | [heroku-buildpacks]: https://github.com/heroku/buildpacks 62 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-inputs/use-inline-buildpacks.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Use an inline buildpack" 4 | aliases=[ 5 | "/docs/app-developer-guide/using-inline-buildpacks" 6 | ] 7 | weight=5 8 | summary="Customize your build with a bit of shell script." 9 | +++ 10 | 11 | You can supplement your app's build process with custom scripts by creating an _inline buildpack_. An inline buildpack is an ephemeral buildpack that's defined in your [project descriptor][project-toml] (i.e. `project.toml`). You can include a script to run as part of the build without setting up all the files and directories that are required for a complete buildpack. 12 | 13 | Inline buildpacks are defined as an entry in the `[[io.buildpacks.group]]` table of the project descriptor by including an `inline` script in the `[io.buildpacks.group.script]` table. 14 | 15 | For example, you may want to run a Rake task against a Ruby app after the Ruby buildpack builds your app. 16 | 17 | ```toml 18 | [_] 19 | schema-version = "0.2" 20 | id = "io.buildpacks.my-app" 21 | 22 | [[io.buildpacks.group]] 23 | id = "example/ruby" 24 | version = "1.0" 25 | 26 | [[io.buildpacks.group]] 27 | id = "me/rake-tasks" 28 | 29 | [io.buildpacks.group.script] 30 | api = "0.10" 31 | inline = "rake package" 32 | ``` 33 | 34 | In this example, the `me/rake-tasks` inline buildpack is configured to run after the `example/ruby` buildpack. The inline script is compatible with Buildpack API version `0.6` (this is a required field), and it will execute the `rake package` command during the build step. 35 | 36 | > **Note:** Inline buildpacks will _always_ pass detection. 37 | 38 | Inline buildpacks aren't constrained to a single command, however. You can define complex scripts as [heredocs](https://toml.io/en/v1.0.0#string) in your project descriptor. For example, this snippet of a descriptor will source a shell script contained in the app repo, use it to modify the app directory (and thus the files that go into the final image), and create slices for the app: 39 | 40 | ```toml 41 | [[io.buildpacks.group]] 42 | id = "me/cleanup" 43 | 44 | [io.buildpacks.group.script] 45 | api = "0.10" 46 | inline = """ 47 | set -e 48 | source scripts/utils.sh 49 | find . -type f -name $(my_data_files) -delete 50 | cat < ${1}/launch.toml 51 | [[processes]] 52 | type = 'bash' 53 | command = ['bin/bash'] 54 | EOF 55 | """ 56 | ``` 57 | 58 | ### Further Reading 59 | For more about project descriptors, look at the [schema][descriptor-schema], as well as the [specification][spec]. 60 | 61 | [project-toml]: /docs/for-app-developers/how-to/build-inputs/use-project-toml/ 62 | [descriptor-schema]: /docs/reference/project-descriptor/ 63 | [spec]: https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md 64 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/re-use-layers.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Re-use dependency layers" 3 | weight=99 4 | +++ 5 | 6 | The [lifecycle](https://buildpacks.io/docs/for-buildpack-authors/concepts/lifecycle-phases/) provides a mechanism for buildpacks to explicitly opt into reusing any necessary [dependency layers](https://buildpacks.io/docs/for-buildpack-authors/concepts/layer/) from a previous build. Buildpacks may modify cached build dependencies before reusing them. 7 | 8 | 9 | 10 | A buildpack usually reads metadata about layers it created during a previous build to ensure only changed layers are updated. For buildpack authors, this can aid in improving build performance by avoiding re-uploading unchanged layers and restoring any previously-cached dependencies. 11 | 12 | To decide whether layer reuse is appropriate, a buildpack should consider: 13 | 14 | * Whether files in the `` directory have changed since the layer was created. 15 | * Whether the environment has changed since the layer was created. 16 | * Whether the buildpack version has changed since the layer was created. 17 | * Whether new application dependency versions have been made available since the layer was created. 18 | 19 | At the start of the `build` phase a buildpack MAY find: 20 | 21 | * Partial `/.toml` files describing layers from the previous builds. The restored `Layer Content Metadata` SHALL NOT contain `launch`, `build`, or `cache` booleans even if those values were set on a previous build. 22 | * `/.sbom.` files that were written previously. 23 | * `//` directories containing layer contents that have been restored from the cache. 24 | 25 | A buildpack: 26 | 27 | * MAY set `launch = true` under `[types]` in the restored `/.toml` file in order to include the layer in the final OCI image. 28 | * MAY modify `metadata` in `/.toml` 29 | * MAY modify `metadata` in `/.sbom.` 30 | * **If** the layer contents have been restored to the `//` directory 31 | * MAY set `build = true` under `[types]` in the restored `/.toml` to expose the layer to subsequent buildpacks. 32 | * MAY set `cache = true` under `[types]` in the restored `/.toml` to persist the layer to subsequent builds. 33 | * MAY modify the contents of `//`. 34 | 35 | If the buildpack does not set `launch`, `build`, or `cache` under `[types]` in the restored `/.toml` the layer SHALL be ignored. 36 | 37 | >For more information on buildpack layer caching, see the documentation on [create dependency layers](https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-layer/) and [buildpack layer types](https://buildpacks.io/docs/for-buildpack-authors/concepts/caching-strategies/). 38 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/tutorials/basic-extension/01_setup-local-environment.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Setting up your local environment" 4 | aliases=[ 5 | "/docs/extension-author-guide/create-extension/setup-local-environment/", 6 | "/docs/extension-guide/create-extension/setup-local-environment" 7 | ] 8 | weight=1 9 | +++ 10 | 11 | 12 | 13 | Let's walk through a build that uses extensions, step by step. We will see an image extension that installs `curl` on 14 | the builder image, and switches the run image to an image that has `curl` installed. 15 | 16 | ### Check system requirements 17 | 18 | Before we get started, make sure you've got the following installed: 19 | 20 | {{< download-button href="https://store.docker.com/search?type=edition&offering=community" color="blue" >}} Install Docker {{}} 21 | {{< download-button href="/docs/install-pack" color="pink" >}} Install pack {{}} 22 | 23 | 24 | 25 | ### Ensure Docker is running 26 | 27 | 28 | ```bash 29 | docker version 30 | ``` 31 | 32 | If you see output similar to the following, you're good to go! Otherwise, start Docker and check again. 33 | 34 | ``` 35 | Client: Docker Engine - Community 36 | Version: 20.10.9 37 | API version: 1.41 38 | Go version: go1.16.8 39 | Git commit: c2ea9bc 40 | Built: Mon Oct 4 16:08:29 2021 41 | OS/Arch: linux/amd64 42 | Context: default 43 | Experimental: true 44 | 45 | Server: Docker Engine - Community 46 | Engine: 47 | Version: 20.10.9 48 | API version: 1.41 (minimum version 1.12) 49 | Go version: go1.16.8 50 | Git commit: 79ea9d3 51 | Built: Mon Oct 4 16:06:34 2021 52 | OS/Arch: linux/amd64 53 | Experimental: false 54 | ``` 55 | 56 | ### Setup workspace directory 57 | 58 | ```bash 59 | cd 60 | ``` 61 | 62 | ### Ensure pack version supports image extensions 63 | 64 | 65 | ```bash 66 | pack version 67 | ``` 68 | 69 | The version should be at least `0.31.0` 70 | 71 | ### Update pack configuration 72 | 73 | 74 | ```bash 75 | pack config experimental true 76 | pack config lifecycle-image --unset 77 | ``` 78 | 79 | As base image extension with Dockerfiles is currently an experimental feature, we must enable it in `pack`. 80 | We unset any custom lifecycle image that may have been provided to ensure that the latest version is used. 81 | 82 | ### Clone the samples repo 83 | 84 | 85 | ```bash 86 | git clone https://github.com/buildpacks/samples.git 87 | ``` 88 | 89 | 90 | --- 91 | 92 | Next Step 93 | 94 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/distribute-buildpacks/package-buildpack.md: -------------------------------------------------------------------------------- 1 | 2 | +++ 3 | title="Package a buildpack or extension" 4 | aliases=[ 5 | "/docs/buildpack-author-guide/package-a-buildpack" 6 | ] 7 | weight=4 8 | summary="Learn how to package your buildpack or extension for distribution." 9 | +++ 10 | 11 | ### 0. Grab the sample repo 12 | 13 | Before we start, let's pull down a few buildpacks from our [samples][samples] repo. 14 | 15 | ```bash 16 | # clone the repo 17 | git clone https://github.com/buildpacks/samples 18 | ``` 19 | 20 | ### 1. Create a `package.toml` 21 | 22 | We will need to create a `package.toml` file in order to tell `pack` where to find the dependencies of the buildpack 23 | being packaged. 24 | 25 | ```shell script 26 | touch package.toml 27 | ``` 28 | 29 | ### 2. Specify your buildpack 30 | 31 | Let's start off by specifying the location of the buildpack we are packaging. In this example, we're packaging 32 | the `hello-universe`. 33 | 34 | `package.toml`: 35 | ```toml 36 | [buildpack] 37 | uri = "samples/buildpacks/hello-universe/" 38 | ``` 39 | 40 | ### 3. Specify your dependent buildpacks 41 | 42 | Next, by looking at the `[[order]]` of the `hello-universe`, we know that it depends on the `hello-world` and `hello-moon` 43 | buildpacks. We will need to declare the location of those dependencies as well. 44 | 45 | `package.toml`: 46 | ```toml 47 | [buildpack] 48 | uri = "samples/buildpacks/hello-universe/" 49 | 50 | [[dependencies]] 51 | uri = "samples/buildpacks/hello-moon" 52 | 53 | [[dependencies]] 54 | uri = "docker://cnbs/sample-package:hello-world" 55 | ``` 56 | 57 | > For more information about the configuration, see [package.toml][package-config] config. 58 | 59 | ### 4. Package your buildpack as an image 60 | 61 | Lastly, we'll run the `buildpack package` command to package the buildpack as an OCI image. 62 | 63 | ```shell script 64 | pack buildpack package my-buildpack --config ./package.toml 65 | ``` 66 | 67 | > **TIP:** You can verify that the image was created by running `docker images`. 68 | 69 | That's it! Your buildpack is now packaged for distribution. 70 | 71 | You may now use standard `docker push` to host your buildpack on any OCI registry of your choosing. 72 | 73 | Alternatively, you can run `pack buildpack package` with `--publish` to publish it directly to the registry. 74 | 75 | ### 5. Package your buildpack as a file 76 | 77 | You can also run `buildpack package` with a `--format file` flag to save the packaged buildpack as a local file. 78 | 79 | ```shell script 80 | pack buildpack package my-buildpack.cnb --config ./package.toml --format file 81 | ``` 82 | 83 | You can then use this file (called a `.cnb` file) as an input to `buildpack package`, among other commands. 84 | 85 | [package-config]: /docs/reference/package-config/ 86 | [samples]: https://github.com/buildpacks/samples 87 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/sidebar.html: -------------------------------------------------------------------------------- 1 | {{- $currentNode := . -}} 2 | 3 | 37 | 38 | 39 | {{- define "section-tree-nav" }} 40 | {{- $parentExpanded := .parentExpanded }} 41 | {{- $currentNode := .currentNode }} 42 | {{- $expand := .expand }} 43 | {{- $depth := .depth }} 44 | {{- with .currentSection}} 45 | {{- if (not (.Params.hidden))}} 46 | {{- $isCurrent := (eq .RelPermalink $currentNode.RelPermalink) -}} 47 | {{- $isParent := (and (.IsAncestor $currentNode) (.IsSection)) -}} 48 | {{- $isCollapsed := (and (gt $depth 0) (not (or $isParent $isCurrent $expand))) }} 49 | {{- $numberOfPages := (add (len .Pages) (len .Sections)) }} 50 | {{- safeHTML .Params.head}} 51 |
  • 57 | {{safeHTML .Params.Pre}}{{.Title | markdownify}}{{safeHTML .Params.Post}} 58 | 59 | {{- if ne $numberOfPages 0 }} 60 | {{- $depth = add (int $depth) 1 }} 61 |
      62 | {{- $expand = (or .Params.expand $isCurrent) -}} 63 | {{- $pages := (.Pages | union .Sections) }} 64 | {{- range $pages.ByWeight }} 65 | {{- if (not .Params.hidden) }} 66 | {{- template "section-tree-nav" dict "currentSection" . "currentNode" $currentNode "depth" $depth "expand" (or $expand $isParent) }} 67 | {{- end}} 68 | {{- end}} 69 |
    70 | {{- end}} 71 |
  • 72 | {{- end}} 73 | {{- end}} 74 | {{- end}} 75 | -------------------------------------------------------------------------------- /themes/buildpacks/layouts/partials/docs.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 | {{ partial "sidebar.html" . }} 6 |
    7 |
    8 | {{ partial "support.html" . }} 9 | 10 |
    11 |

    {{ .Title | markdownify }}

    12 |
    13 | 14 | {{ .Content }} 15 | 16 | {{ if .Params.include_summaries }} 17 | {{- $titleOnlyAfterDepth := (int .Params.summaries_titles_only_after_depth | default 1) -}} 18 | {{- $maxDepth := (int .Params.summaries_max_depth | default 2) -}} 19 | {{- template "subsection-summary" dict "currentSection" . "depth" 0 "titleOnlyAfterDepth" $titleOnlyAfterDepth "maxDepth" $maxDepth -}} 20 | {{ end }} 21 | 22 | {{ partial "footline.html" . }} 23 |
    24 |
    25 |
    26 |
    27 | 28 | 29 | {{- define "subsection-summary" }} 30 | {{- $depth := (int .depth) }} 31 | {{- $maxDepth := (int .maxDepth) }} 32 | {{- $titleOnlyAfterDepth := .titleOnlyAfterDepth }} 33 | {{- $headerLvl := (add $depth 2) -}} 34 | {{- if (lt $depth $maxDepth) -}} 35 | {{- with .currentSection}} 36 | {{- $pages := sort (.Pages | union .Sections) "Weight" }} 37 | {{ range $pages }} 38 | {{ if (ge $depth $titleOnlyAfterDepth) }} 39 |
      40 |
    • {{ .Title }}
    • 41 | {{ if .Params.include_summaries }} 42 | {{- template "subsection-summary" dict "currentSection" . "depth" (add $depth 1) "titleOnlyAfterDepth" $titleOnlyAfterDepth "maxDepth" $maxDepth -}} 43 | {{ end }} 44 |
    45 | {{ else }} 46 | {{ .Title | markdownify }} 47 |

    {{ .Summary | replaceRE ".*" "" | markdownify | safeHTML }}

    48 | 49 | {{ if .Params.include_summaries }} 50 | {{- template "subsection-summary" dict "currentSection" . "depth" (add $depth 1) "titleOnlyAfterDepth" $titleOnlyAfterDepth "maxDepth" $maxDepth -}} 51 | 52 | {{- if (eq (add $depth 1) $maxDepth) -}} 53 |
    54 | Learn more → 55 |
    56 | {{- end }} 57 | {{ else }} 58 |
    59 | Learn more → 60 |
    61 | {{- end }} 62 | {{- end }} 63 | {{- end }} 64 | {{- end }} 65 | {{- end }} 66 | {{- end}} 67 | -------------------------------------------------------------------------------- /content/docs/for-app-developers/how-to/build-outputs/inspect-app.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Inspect your application image" 3 | weight=2 4 | +++ 5 | 6 | Buildpacks-built images contain metadata that allow you to audit both the image itself and the build process. 7 | 8 | 9 | 10 | Information includes: 11 | 12 | * The process types that are available and the commands associated with them 13 | * The run-image the app image was based on 14 | * The buildpacks were used to create the app image 15 | * Whether the run-image can be rebased with a new version through the `Rebasable` label or not 16 | * And more...! 17 | 18 | `pack` offers a command to help you inspect the application image and view some of its contents as shown below: 19 | 20 | ```bash 21 | pack inspect-image test-node-js-app 22 | ``` 23 | 24 | You should see the following: 25 | 26 | ```text 27 | Run Images: 28 | cnbs/sample-base-run:noble 29 | ... 30 | 31 | Buildpacks: 32 | ID VERSION HOMEPAGE 33 | examples/node-js 0.0.1 - 34 | 35 | Processes: 36 | TYPE SHELL COMMAND ARGS WORK DIR 37 | web (default) bash node-js app.js /workspace 38 | ``` 39 | 40 | Apart from the above standard metadata, buildpacks can also populate information about the dependencies they have provided in form of a `Software Bill-of-Materials` or [SBOM]. 41 | 42 | Buildpacks-built images are constructed in a way that’s easy to understand, with each of the layers being meaningful and independent of all other layers. You can get more details about each layer and how it was created to better understand how the [build] actually worked. 43 | 44 | There are a number of available tools that can help you achieve this and understand what is contained in your `OCI` image; a popular one is [dive]. 45 | 46 | `Dive` can help you inspect `OCI` images and view their layers and each layer's details. If you were to build an `OCI` image following the [multi process app] example and run `dive` on the generated image, you'll be presented with some detailed information about all of the image layers and the contents of each layer. 47 | 48 | You can use `dive` as follows: 49 | 50 | ```bash 51 | dive multi-process-app 52 | ``` 53 | 54 | The output should look similar to the following: 55 | 56 | PLACEHOLDER 57 | 58 | As seen in the output above, you're presented with `Layers`, `Layer Details`, `Image Details`, and `Current Layer Contents`. To view the contents or explore the file tree of any layer, you need to select the layer on the left using the arrow keys. 59 | 60 | [SBOM]: /docs/for-app-developers/how-to/build-outputs/download-sbom 61 | [build]: https://buildpacks.io/docs/for-app-developers/concepts/build/ 62 | [Dive]: https://github.com/wagoodman/dive 63 | [multi process app]: https://buildpacks.io/docs/for-app-developers/how-to/build-outputs/specify-launch-process/#build-a-multi-process-app 64 | -------------------------------------------------------------------------------- /content/docs/for-buildpack-authors/how-to/write-buildpacks/specify-launch-processes.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Specify process types" 3 | weight=4 4 | +++ 5 | 6 | One of the benefits of buildpacks is that they are multi-process - an image can have multiple entrypoints for each operational mode. 7 | 8 | 9 | 10 | A `process type` is a named process definition, contributed by a buildpack at build-time and executed by the launcher at run-time. 11 | Buildpacks declare process types during the build phase by writing entries into `/launch.toml`. 12 | 13 | ## Key Points 14 | 15 | For each process, the buildpack: 16 | 17 | * MUST specify a `type`, an identifier for the process, which: 18 | * MUST NOT be identical to other process types provided by the same buildpack. 19 | * MUST only contain numbers, letters, and the characters `.`, `_`, and `-`. 20 | * MUST specify a `command` list such that: 21 | * The first element of `command` is a path to an executable or the file name of an executable in `$PATH`. 22 | * Any remaining elements of `command` are arguments that are always passed directly to the executable [^command-args]. 23 | * MAY specify an `args` list to be passed directly to the specified executable, after arguments specified in `command`. 24 | * The `args` list is a default list of arguments that may be overridden by the user [^command-args]. 25 | * MAY specify a `default` boolean that indicates that the process type should be selected as the [buildpack-provided default](https://github.com/buildpacks/spec/blob/main/platform.md#outputs-4) during the export phase. 26 | * MAY specify a `working-dir` for the process. The `working-dir` defaults to the application directory if not specified. 27 | 28 | ## Implementation Steps 29 | 30 | Processes are added to the `launch.toml` file in the `/` directory as follows: 31 | 32 | ```toml 33 | [[processes]] 34 | type = "" 35 | command = [""] 36 | args = [""] 37 | default = false 38 | working-dir = "" 39 | ``` 40 | 41 | ### Examples 42 | 43 | Let's see how this works. We will specify a process type that allows a debugger to attach to our application. 44 | 45 | To enable running the debug process, we'll need to have our buildpack define a "process type" for the worker. 46 | We'll need to create a `launch.toml` file in the buildpack layers directory: 47 | 48 | ```bash 49 | # ... 50 | 51 | cat > "${CNB_LAYERS_DIR}/launch.toml" << EOL 52 | # our web process 53 | [[processes]] 54 | type = "web" 55 | command = ["node", "app.js"] 56 | default = true 57 | 58 | # our debug process 59 | [[processes]] 60 | type = "debug" 61 | command = ["node", "--inspect", "app.js"] 62 | EOL 63 | 64 | # ... 65 | ``` 66 | 67 | After building the application, you should then be able to run your new NodeJS debug process: 68 | 69 | ```bash 70 | docker run --rm --entrypoint debug test-node-js-app 71 | ``` 72 | 73 | and see the debug log output: 74 | 75 | ```text 76 | Debugger listening on ws://127.0.0.1:9229/ 77 | ``` 78 | -------------------------------------------------------------------------------- /themes/buildpacks/assets/scss/components/_button.scss: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Button 4 | 5 | **********************************/ 6 | 7 | /** Sizes **/ 8 | 9 | $btn-font-size: 1rem; 10 | $btn-sm-font-size: .80rem; 11 | $btn-h-padding: 20px; 12 | $btn-v-padding: 10px; 13 | $icon-proportion: 1.30; 14 | 15 | %button-base { 16 | padding: $btn-v-padding $btn-h-padding; 17 | border-radius: 5px; 18 | display: inline-block; 19 | text-decoration: none; 20 | line-height: 130%; 21 | font-size: $btn-font-size; 22 | } 23 | 24 | %button-base:hover { 25 | text-decoration: none; 26 | opacity: .9; 27 | } 28 | 29 | .button-small { 30 | font-size: $btn-sm-font-size; 31 | padding: $btn-v-padding*.75 $btn-h-padding*.75; 32 | } 33 | 34 | /** Colors **/ 35 | 36 | .button { 37 | @extend %button-base; 38 | color: white; 39 | } 40 | 41 | .button:hover { 42 | color: white; 43 | text-decoration: none; 44 | opacity: .9; 45 | } 46 | 47 | .button-light { 48 | @extend %button-base; 49 | color: #000000; 50 | border: 1px solid #e0e0e0; 51 | } 52 | 53 | .button-light:hover { 54 | color: #000000; 55 | opacity: .75; 56 | } 57 | 58 | /** Special **/ 59 | 60 | .icon-button { 61 | display: flex; 62 | width: fit-content; 63 | padding-right: $btn-h-padding + 5px; /* makes them look more even to have more right padding */ 64 | } 65 | 66 | .icon-button::before { 67 | content: ''; 68 | display: inline-block; 69 | align-self: center; 70 | margin: 0 10px 0 0; 71 | height: $btn-font-size * $icon-proportion; 72 | width: $btn-font-size * $icon-proportion; 73 | min-width: $btn-font-size * $icon-proportion; 74 | background-repeat: no-repeat; 75 | background-size: contain; 76 | } 77 | 78 | .button-small.icon-button { 79 | padding-right: ($btn-h-padding + 5px) * .75; 80 | } 81 | 82 | .button-small.icon-button::before { 83 | height: $btn-sm-font-size * $icon-proportion; 84 | width: $btn-sm-font-size * $icon-proportion; 85 | min-width: $btn-sm-font-size * $icon-proportion; 86 | } 87 | 88 | .icon-button.blank::before { 89 | width: 0px; 90 | min-width: 0px; 91 | } 92 | 93 | .button-small.icon-button.blank::before { 94 | width: 0px; 95 | min-width: 0px; 96 | } 97 | 98 | .button.download-button::before { 99 | background-image: url('/images/download-icon.svg'); 100 | } 101 | 102 | .button.learn-button::before { 103 | background-image: url('/images/learn-icon.svg'); 104 | } 105 | 106 | .button.github-button::before { 107 | background-image: url('/images/github-mark.svg'); 108 | } 109 | 110 | .button-light.github-button::before { 111 | background-image: url('/images/github-mark.svg'); 112 | -webkit-filter: brightness(0); 113 | filter: brightness(0); 114 | } 115 | 116 | .button.slack-button::before { 117 | background-image: url('/images/slack-mark.svg'); 118 | } 119 | 120 | .button-light.slack-button::before { 121 | background-image: url('/images/slack-mark.svg'); 122 | -webkit-filter: brightness(0); 123 | filter: brightness(0); 124 | } --------------------------------------------------------------------------------