pack buildpack package

pack buildpack package

Package a buildpack in OCI format.


buildpack package allows users to package (a) buildpack(s) into OCI format, which can then to be hosted in image repositories or persisted on disk as a ‘.cnb’ file. You can also package a number of buildpacks together, to enable easier distribution of a set of buildpacks. Packaged buildpacks can be used as inputs to pack build (using the --buildpack flag), and they can be included in the configs used in pack builder create and pack buildpack package. For more on how to package a buildpack, see:

pack buildpack package <name> --config <config-path> [flags]


pack buildpack package my-buildpack --config ./package.toml
pack buildpack package my-buildpack.cnb --config ./package.toml --f file


  -r, --buildpack-registry string   Buildpack Registry name
  -c, --config string               Path to package TOML config
      --flatten                     Flatten the buildpack into a single layer
  -e, --flatten-exclude strings     Buildpacks to exclude from flattening, in the form of '<buildpack-id>@<buildpack-version>'
  -f, --format string               Format to save package as ("image" or "file")
  -h, --help                        Help for 'package'
  -l, --label stringToString        Labels to add to packaged Buildpack, in the form of '<name>=<value>' (default [])
  -p, --path string                 Path to the Buildpack that needs to be packaged
      --publish                     Publish the buildpack directly to the container registry specified in <name>, instead of the daemon (applies to "--format=image" only).
      --pull-policy string          Pull policy to use. Accepted values are always, never, and if-not-present. The default is always

Options inherited from parent commands

      --force-color   Force color output
      --no-color      Disable color output
  -q, --quiet         Show less output
      --timestamps    Enable timestamps in output
  -v, --verbose       Show more output