Search code examples
buildpack

Pack's CLI buildpack package command returns ERROR unknown configuration elements


I'm trying to build my custom buildpack, I have a buildpack.toml file:

api = "0.5"

[buildpack]
id = "localhost:5000/test-buildpack"
version = "0.0.1"

I'm using command:

pack buildpack package test-buildpack --config ./buildpack.toml

unfortunately Pack CLI returns error:

ERROR: reading config: unknown configuration elements api, buildpack.id, buildpack.version in ./buildpack.toml

What am I missing?

Pack CLI version: 0.18.1


Solution

  • The config file that pack buildpack package expects is the package.toml file not the buildpack.toml file.

    See -

    https://buildpacks.io/docs/reference/config/package-config/ https://buildpacks.io/docs/tools/pack/cli/pack_buildpack_package/

    The package.toml file isn't always necessary and you can just omit passing the --config flag and/or creating a package.toml file if you are creating a standalone buildpack which doesn't depend on other buildpacks.