Skip to content

Commit c85e325

Browse files
author
Natalie Arellano
authored
Merge branch 'main' into 1799-pack-inspect
Signed-off-by: Natalie Arellano <[email protected]>
2 parents ca731e6 + 90f73a7 commit c85e325

File tree

17 files changed

+67
-87
lines changed

17 files changed

+67
-87
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- name: Git Checkout
1919
uses: actions/checkout@v3
2020
- name: Setup Go environment
21-
uses: actions/setup-go@v3
21+
uses: actions/setup-go@v4
2222
with:
2323
go-version: '1.x'
2424
- name: Install Dependencies
2525
run: sudo apt-get install make curl jq
2626
- name: Install pack
2727
uses: buildpacks/github-actions/[email protected]
2828
with:
29-
pack-version: '0.28.0'
29+
pack-version: '0.30.0-rc1'
3030
- name: Test
3131
run: make test
3232
env:

content/docs/app-developer-guide/specify-buildpacks.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ summary="Learn how to specify exactly what buildpacks are used during the build
99

1010
You may specify exactly what buildpacks are used during the build process by referencing them with a URI in any of the following formats.
1111

12-
| Type | Format |
13-
|----- |------- |
14-
| Relative | `<path>` |
15-
| Filesystem | `file://[<host>]/<path>` |
16-
| URL | `http[s]://<host>/<path>` |
17-
| Docker | `docker://[<host>]/<path>[:<tag>⏐@<digest>]` |
18-
| CNB Builder Resource | `urn:cnb:builder[:<id>[@<version>]]` |
19-
| CNB Registry Resource | `urn:cnb:registry[:<id>[@<version>]]` |
12+
| Type | Format |
13+
| --------------------- | -------------------------------------------- |
14+
| Relative | `<path>` |
15+
| Filesystem | `file://[<host>]/<path>` |
16+
| URL | `http[s]://<host>/<path>` |
17+
| Docker | `docker://[<host>]/<path>[:<tag>⏐@<digest>]` |
18+
| CNB Builder Resource | `urn:cnb:builder[:<id>[@<version>]]` |
19+
| CNB Registry Resource | `urn:cnb:registry[:<id>[@<version>]]` |
2020

2121
##### Fallback Behavior
2222

@@ -60,7 +60,7 @@ The [`project.toml`][project-toml] format allows for Buildpack URIs to be specif
6060

6161
```toml
6262
[_]
63-
schema-version = "0.3"
63+
schema-version = "0.2"
6464
id = "sample-java-maven-app"
6565
name = "Sample Java App"
6666
version = "1.0.0"

content/docs/app-developer-guide/using-project-descriptor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ file at the root of the application. For more on `gitignore` matching see [these
2020

2121
```toml
2222
[_]
23+
schema-version = "0.2"
2324
id = "io.buildpacks.bash-script"
2425
name = "Bash Script"
2526
version = "1.0.0"
@@ -68,6 +69,7 @@ Below is an expanded `project.toml`, with an additional buildpack and environmen
6869

6970
```toml
7071
[_]
72+
schema-version = "0.2"
7173
id = "io.buildpacks.bash-script"
7274
name = "Bash Script"
7375
version = "1.0.0"

content/docs/buildpack-author-guide/create-buildpack/adding-bill-of-materials.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ pack inspect-image test-ruby-app
2222
<!--+- "{{execute}}"+-->
2323
You should see the following:
2424

25-
<!-- test:assert=contains -->
25+
<!-- test:assert=contains;ignore-lines=... -->
2626
```text
2727
Run Images:
2828
cnbs/sample-stack-run:jammy
29-
30-
Rebasable: true
29+
...
3130
3231
Buildpacks:
3332
ID VERSION HOMEPAGE

content/docs/buildpack-author-guide/create-buildpack/building-blocks-cnb.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ The `pack build` command takes in your Ruby sample app as the `--path` argument
116116

117117
After running the command, you should see that it failed to detect, as the `detect` script is currently written to simply error out.
118118

119-
<!-- test:assert=contains -->
119+
<!-- test:assert=contains;ignore-lines=... -->
120120
```
121121
===> DETECTING
122+
...
122123
err: examples/[email protected] (1)
124+
...
123125
ERROR: No buildpack groups passed detection.
124126
ERROR: failed to detect: buildpack(s) failed with err
125127
```

content/docs/buildpack-author-guide/create-buildpack/caching.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ it will download the gems:
256256
<!-- test:assert=contains;ignore-lines=... -->
257257
```text
258258
===> BUILDING
259+
...
259260
---> Ruby Buildpack
260261
---> Downloading and extracting Ruby
261262
---> Installing gems
@@ -274,6 +275,7 @@ you will see the new caching logic at work during the `BUILDING` phase:
274275
<!-- test:assert=contains;ignore-lines=... -->
275276
```text
276277
===> BUILDING
278+
...
277279
---> Ruby Buildpack
278280
---> Downloading and extracting Ruby
279281
---> Reusing gems

content/docs/buildpack-author-guide/create-buildpack/make-buildpack-configurable.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ pack build test-ruby-app --path ./ruby-sample-app --buildpack ./ruby-buildpack
126126
127127
You will notice that version of Ruby specified in the app's `.ruby-version` file is downloaded.
128128
129-
<!-- test:assert=contains -->
129+
<!-- test:assert=contains;ignore-lines=... -->
130130
```text
131131
===> BUILDING
132+
...
132133
---> Ruby Buildpack
133134
---> Downloading and extracting Ruby 3.1.0
134135
```

content/docs/extension-guide/create-extension/build-dockerfile.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,34 @@ aliases = [
88

99
<!-- test:suite=dockerfiles;weight=4 -->
1010

11-
### Examine `tree` extension
11+
### Examine `vim` extension
1212

1313
#### detect
1414

1515
<!-- test:exec -->
1616
```bash
17-
cat $PWD/samples/extensions/tree/bin/detect
17+
cat $PWD/samples/extensions/vim/bin/detect
1818
```
1919

20-
The extension always detects (because its exit code is `0`) and provides a dependency called `tree` by writing to the build plan.
20+
The extension always detects (because its exit code is `0`) and provides a dependency called `vim` by writing to the build plan.
2121

2222
#### generate
2323

2424
<!-- test:exec -->
2525
```bash
26-
cat $PWD/samples/extensions/tree/bin/generate
26+
cat $PWD/samples/extensions/vim/bin/generate
2727
```
2828

29-
The extension generates a `build.Dockerfile` that installs `tree` on the builder image.
30-
31-
### Re-create our builder with `hello-extensions` updated to require `tree`
32-
33-
Edit `$PWD/samples/buildpacks/hello-extensions/bin/detect` to uncomment the first set of lines that output `[[requires]]` to the build plan:
34-
35-
<!-- test:exec -->
36-
```bash
37-
sed -i "10,11s/#//" $PWD/samples/buildpacks/hello-extensions/bin/detect
38-
```
39-
40-
(On Mac, use `sed -i '' "10,11s/#//" $PWD/samples/buildpacks/hello-extensions/bin/detect`)
41-
42-
Re-create the builder:
43-
44-
<!-- test:exec -->
45-
```
46-
pack builder create localhost:5000/extensions-builder \
47-
--config $PWD/samples/builders/alpine/builder.toml \
48-
--publish
49-
```
29+
The extension generates a `build.Dockerfile` that installs `vim` on the builder image.
5030

5131
### Re-build the application image
5232

5333
<!-- test:exec -->
5434
```
5535
pack build hello-extensions \
5636
--builder localhost:5000/extensions-builder \
37+
--env BP_EXT_DEMO=1 \
38+
--env BP_REQUIRES=vim \
5739
--network host \
5840
--path $PWD/samples/apps/java-maven \
5941
--pull-policy always \
@@ -66,19 +48,19 @@ You should see:
6648

6749
```
6850
[detector] ======== Results ========
69-
[detector] pass: samples/tree@0.0.1
51+
[detector] pass: samples/vim@0.0.1
7052
[detector] pass: samples/[email protected]
7153
[detector] Resolving plan... (try #1)
72-
[detector] samples/tree 0.0.1
54+
[detector] samples/vim 0.0.1
7355
[detector] samples/hello-extensions 0.0.1
74-
[detector] Running generate for extension samples/tree@0.0.1
56+
[detector] Running generate for extension samples/vim@0.0.1
7557
...
76-
[extender] Found build Dockerfile for extension 'samples/tree'
77-
[extender] Applying the Dockerfile at /layers/generated/build/samples_tree/Dockerfile...
58+
[extender] Found build Dockerfile for extension 'samples/vim'
59+
[extender] Applying the Dockerfile at /layers/generated/build/samples_vim/Dockerfile...
7860
...
7961
[extender] Running build command
8062
[extender] ---> Hello Extensions Buildpack
81-
[extender] tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
63+
[extender] vim v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
8264
...
8365
Successfully built image hello-extensions
8466
```

content/docs/extension-guide/create-extension/building-blocks-extension.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ aliases = [
88

99
<!-- test:suite=dockerfiles;weight=3 -->
1010

11-
### Examine `tree` extension
11+
### Examine `vim` extension
1212

1313
<!-- test:exec -->
1414
```bash
15-
tree $PWD/samples/extensions/tree
15+
vim --help
1616
```
1717

1818
(That's right, we're using the very tool we will later be installing!) You should see something akin to the following:
@@ -27,7 +27,7 @@ tree $PWD/samples/extensions/tree
2727

2828
* The `extension.toml` describes the extension, containing information such as its name, ID, and version, as well as the
2929
buildpack API that it implements. Though extensions are not buildpacks, they are expected to conform to the buildpack
30-
API except where noted. Consult the [spec](https://github.com/buildpacks/spec/blob/buildpack/main/image_extension.md)
30+
API except where noted. Consult the [spec](https://github.com/buildpacks/spec/blob/main/image_extension.md)
3131
for further details.
3232
* `./bin/detect` is invoked during the `detect` phase. It analyzes application source code to determine if the extension
3333
is needed and contributes [build plan](/docs/reference/spec/buildpack-api/#build-plan) entries (much like a
@@ -36,15 +36,15 @@ tree $PWD/samples/extensions/tree
3636
* `./bin/generate` is invoked during the `generate` phase (a new lifecycle phase that happens after `detect`). It
3737
outputs either or both of `build.Dockerfile` or `run.Dockerfile` for extending the builder or run image, respectively.
3838
* Only a limited set of Dockerfile instructions is supported - consult
39-
the [spec](https://github.com/buildpacks/spec/blob/buildpack/main/image_extension.md)
39+
the [spec](https://github.com/buildpacks/spec/blob/main/image_extension.md)
4040
for further details.
4141
* In the [initial implementation](/docs/features/dockerfiles#phased-approach), `run.Dockerfile` instructions are
4242
limited to a single `FROM` instruction (effectively, it is only possible to switch the run-time base image to a
4343
pre-created image i.e., no dynamic image modification is allowed). Consult
44-
the [spec](https://github.com/buildpacks/spec/blob/buildpack/main/image_extension.md)
44+
the [spec](https://github.com/buildpacks/spec/blob/main/image_extension.md)
4545
for further details.
4646

47-
We'll take a closer look at the executables for the `tree` extension in the next step.
47+
We'll take a closer look at the executables for the `vim` extension in the next step.
4848

4949
<!--+ if false+-->
5050
---

content/docs/extension-guide/create-extension/run-dockerfile.md

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,7 @@ Build the run image:
4545
```bash
4646
docker build \
4747
--file $PWD/samples/stacks/alpine/run/curl.Dockerfile \
48-
--tag run-image-curl .
49-
```
50-
51-
### Re-create our builder with `hello-extensions` updated to require `curl`
52-
53-
Edit `$PWD/samples/buildpacks/hello-extensions/bin/detect` to uncomment the second set of lines that output `[[requires]]` to the build plan:
54-
55-
<!-- test:exec -->
56-
```bash
57-
sed -i "14,15s/#//" $PWD/samples/buildpacks/hello-extensions/bin/detect
58-
```
59-
60-
(On Mac, use `sed -i '' "14,15s/#//" $PWD/samples/buildpacks/hello-extensions/bin/detect`)
61-
62-
Re-create the builder:
63-
64-
<!-- test:exec -->
65-
```bash
66-
pack builder create localhost:5000/extensions-builder \
67-
--config $PWD/samples/builders/alpine/builder.toml \
68-
--publish
48+
--tag localhost:5000/run-image-curl .
6949
```
7050

7151
### Re-build the application image
@@ -74,6 +54,8 @@ pack builder create localhost:5000/extensions-builder \
7454
```bash
7555
pack build hello-extensions \
7656
--builder localhost:5000/extensions-builder \
57+
--env BP_EXT_DEMO=1 \
58+
--env BP_REQUIRES=vim,curl \
7759
--path $PWD/samples/apps/java-maven \
7860
--pull-policy always \
7961
--network host \
@@ -86,26 +68,26 @@ You should see:
8668

8769
```
8870
[detector] ======== Results ========
89-
[detector] pass: samples/tree@0.0.1
71+
[detector] pass: samples/vim@0.0.1
9072
[detector] pass: samples/[email protected]
9173
[detector] pass: samples/[email protected]
9274
[detector] Resolving plan... (try #1)
93-
[detector] samples/tree 0.0.1
75+
[detector] samples/vim 0.0.1
9476
[detector] samples/curl 0.0.1
9577
[detector] samples/hello-extensions 0.0.1
96-
[detector] Running generate for extension samples/tree@0.0.1
78+
[detector] Running generate for extension samples/vim@0.0.1
9779
...
9880
[detector] Running generate for extension samples/[email protected]
9981
...
10082
[detector] Checking for new run image
10183
[detector] Found a run.Dockerfile configuring image 'run-image-curl' from extension with id 'samples/curl'
10284
...
103-
[extender] Found build Dockerfile for extension 'samples/tree'
104-
[extender] Applying the Dockerfile at /layers/generated/build/samples_tree/Dockerfile...
85+
[extender] Found build Dockerfile for extension 'samples/vim'
86+
[extender] Applying the Dockerfile at /layers/generated/build/samples_vim/Dockerfile...
10587
...
10688
[extender] Running build command
10789
[extender] ---> Hello Extensions Buildpack
108-
[extender] tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
90+
[extender] vim v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
10991
...
11092
Successfully built image hello-extensions
11193
```
@@ -123,16 +105,16 @@ You should see something akin to:
123105
curl 7.85.0-DEV (x86_64-pc-linux-musl) ... more stuff here ...
124106
```
125107

126-
What happened: now that `hello-extensions` requires both `tree` and `curl` in its build plan, both extensions are
108+
What happened: now that `hello-extensions` requires both `vim` and `curl` in its build plan, both extensions are
127109
included in the build and provide the needed dependencies for build and launch, respectively
128-
* The `tree` extension installs `tree` at build time, as before
110+
* The `vim` extension installs `vim` at build time, as before
129111
* The `curl` extension switches the run image to `run-image-curl`, which has `curl` installed
130112

131113
Now our `curl` process can succeed!
132114

133115
## What's next?
134116

135-
The `tree` and `curl` examples are very simple, but we can unlock powerful new features with this functionality.
117+
The `vim` and `curl` examples are very simple, but we can unlock powerful new features with this functionality.
136118

137119
Platforms could have several run images available, each tailored to a specific language family, thus limiting the number
138120
of installed dependencies for each image to the minimum necessary to support the targeted language. Image extensions

0 commit comments

Comments
 (0)