Skip to content

Commit

Permalink
Prefer targets over stacks
Browse files Browse the repository at this point in the history
When creating a new buildpack, use --targets instead of the
deprecated --stacks

Signed-off-by: Aidan Delaney <[email protected]>
  • Loading branch information
AidanDelaney committed Nov 27, 2024
1 parent 02f1cbf commit 1491ad1
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pack buildpack new examples/node-js \
--api 0.10 \
--path node-js-buildpack \
--version 0.0.1 \
--stacks io.buildpacks.samples.stacks.noble
--targets "linux/amd64"
```
<!--+- "{{execute}}"+-->
This command will create `node-js-buildpack` directory which contains `buildpack.toml`, `bin/build`, `bin/detect` files.
Expand All @@ -46,6 +46,11 @@ You will have `node-js-buildpack/buildpack.toml`<!--+"{{open}}"+--> in your buil
```toml
# Buildpack API version
api = "0.10"
# Enable to allow the buildpack to build on a Windows target
WithWindowsBuild = false
# Enable to force the buildpack to build only on supported Linux targets
# "false" by default, which allows the buildpack to build on *all* Linux targets
WithLinuxBuild = false

# Buildpack ID and metadata
[buildpack]
Expand All @@ -54,12 +59,8 @@ api = "0.10"

# Targets the buildpack will work with
[[targets]]
os = "linux"

# Stacks (deprecated) the buildpack will work with
[[stacks]]
id = "io.buildpacks.samples.stacks.noble"

os = "linux"
arch = "amd64"
```

The buildpack ID is the way you will reference the buildpack when you create buildpack groups, builders, etc.
Expand Down

0 comments on commit 1491ad1

Please sign in to comment.