Skip to content

Commit c0dd6c5

Browse files
author
Natalie Arellano
committed
Update docs to use vim sample instead of tree
Signed-off-by: Natalie Arellano <[email protected]>
1 parent ab71153 commit c0dd6c5

File tree

6 files changed

+49
-56
lines changed

6 files changed

+49
-56
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@ aliases = [
1111
Builder images can be kept lean if image extensions are used to dynamically install the needed dependencies
1212
for the current application.
1313

14-
### Examine `tree` extension
14+
### Examine `vim` extension
1515

1616
#### detect
1717

1818
<!-- test:exec -->
1919
```bash
20-
cat $PWD/samples/extensions/tree/bin/detect
20+
cat $PWD/samples/extensions/vim/bin/detect
2121
```
2222

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

2525
#### generate
2626

2727
<!-- test:exec -->
2828
```bash
29-
cat $PWD/samples/extensions/tree/bin/generate
29+
cat $PWD/samples/extensions/vim/bin/generate
3030
```
3131

32-
The extension generates a `build.Dockerfile` that installs `tree` on the builder image.
32+
The extension generates a `build.Dockerfile` that installs `vim` on the builder image.
3333

34-
### Configure the `hello-extensions` buildpack to require `tree`
34+
### Configure the `hello-extensions` buildpack to require `vim`
3535

36-
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require `tree` (review the `./bin/detect` script to see why this works).
36+
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require `vim` (review the `./bin/detect` script to see why this works).
3737

3838
<!-- test:exec -->
3939
```
4040
pack build hello-extensions \
4141
--builder localhost:5000/extensions-builder \
4242
--env BP_EXT_DEMO=1 \
43-
--env BP_REQUIRES=tree \
43+
--env BP_REQUIRES=vim \
4444
--network host \
4545
--path $PWD/samples/apps/java-maven \
4646
--pull-policy always \
@@ -54,24 +54,24 @@ You should see:
5454
```
5555
...
5656
[detector] ======== Results ========
57-
[detector] pass: samples/tree@0.0.1
57+
[detector] pass: samples/vim@0.0.1
5858
[detector] pass: samples/[email protected]
5959
[detector] pass: samples/[email protected]
6060
[detector] pass: samples/[email protected]
6161
[detector] Resolving plan... (try #1)
6262
[detector] skip: samples/[email protected] provides unused curl
6363
[detector] skip: samples/[email protected] provides unused cowsay
6464
[detector] 2 of 4 buildpacks participating
65-
[detector] samples/tree 0.0.1
65+
[detector] samples/vim 0.0.1
6666
[detector] samples/hello-extensions 0.0.1
67-
[detector] Running generate for extension samples/tree@0.0.1
67+
[detector] Running generate for extension samples/vim@0.0.1
6868
...
69-
[extender (build)] Found build Dockerfile for extension 'samples/tree'
70-
[extender (build)] Applying the Dockerfile at /layers/generated/build/samples_tree/Dockerfile...
69+
[extender (build)] Found build Dockerfile for extension 'samples/vim'
70+
[extender (build)] Applying the Dockerfile at /layers/generated/build/samples_vim/Dockerfile...
7171
...
7272
[extender (build)] Running build command
7373
[extender (build)] ---> Hello Extensions Buildpack
74-
[extender (build)] tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
74+
[extender (build)] VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 19 2023 16:28:36)
7575
...
7676
Successfully built image hello-extensions
7777
```

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ 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+
tree $PWD/samples/extensions/vim
1616
```
1717

18-
(That's right, we're using the very tool we will later be installing!) You should see something akin to the following:
18+
You should see something akin to the following:
1919

2020
```
2121
.
@@ -44,7 +44,7 @@ tree $PWD/samples/extensions/tree
4444
the [spec](https://github.com/buildpacks/spec/blob/buildpack/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-extend.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ docker push localhost:5000/run-image-curl
4040

4141
### Configure the `hello-extensions` buildpack to require `cowsay`
4242

43-
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require both `tree` and `curl` (review the `./bin/detect` script to see why this works).
43+
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require both `vim` and `curl` (review the `./bin/detect` script to see why this works).
4444

4545
<!-- test:exec -->
4646
```bash
4747
pack build hello-extensions \
4848
--builder localhost:5000/extensions-builder \
4949
--env BP_EXT_DEMO=1 \
50-
--env BP_REQUIRES=tree,curl,cowsay \
50+
--env BP_REQUIRES=vim,curl,cowsay \
5151
--path $PWD/samples/apps/java-maven \
5252
--pull-policy always \
5353
--network host \
@@ -61,25 +61,25 @@ You should see:
6161
```
6262
...
6363
[detector] ======== Results ========
64-
[detector] pass: samples/tree@0.0.1
64+
[detector] pass: samples/vim@0.0.1
6565
[detector] pass: samples/[email protected]
6666
[detector] pass: samples/[email protected]
6767
[detector] pass: samples/[email protected]
6868
[detector] Resolving plan... (try #1)
69-
[detector] samples/tree 0.0.1
69+
[detector] samples/vim 0.0.1
7070
[detector] samples/curl 0.0.1
7171
[detector] samples/cowsay 0.0.1
7272
[detector] samples/hello-extensions 0.0.1
73-
[detector] Running generate for extension samples/tree@0.0.1
73+
[detector] Running generate for extension samples/vim@0.0.1
7474
...
7575
[detector] Running generate for extension samples/[email protected]
7676
...
7777
[detector] Running generate for extension samples/[email protected]
7878
...
7979
[detector] Found a run.Dockerfile from extension 'samples/curl' setting run image to 'localhost:5000/run-image-curl'
8080
...
81-
[extender (build)] Found build Dockerfile for extension 'samples/tree'
82-
[extender (build)] Applying Dockerfile at /layers/generated/build/samples_tree/Dockerfile...
81+
[extender (build)] Found build Dockerfile for extension 'samples/vim'
82+
[extender (build)] Applying Dockerfile at /layers/generated/build/samples_vim/Dockerfile...
8383
[extender (run)] Found run Dockerfile for extension 'samples/curl'
8484
[extender (run)] Found run Dockerfile for extension 'samples/cowsay'
8585
[extender (run)] Applying Dockerfile at /layers/generated/run/samples_curl/Dockerfile...
@@ -88,7 +88,7 @@ You should see:
8888
...
8989
[extender (build)] Running build command
9090
[extender (build)] ---> Hello Extensions Buildpack
91-
[extender (build)] tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
91+
[extender (build)] VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 19 2023 16:28:36)
9292
...
9393
Successfully built image hello-extensions
9494
```

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ Build the run image:
5050
docker build \
5151
--file $PWD/samples/stacks/alpine/run/curl.Dockerfile \
5252
--tag localhost:5000/run-image-curl .
53+
54+
docker push localhost:5000/run-image-curl
5355
```
5456

5557
### Configure the `hello-extensions` buildpack to require `curl`
5658

57-
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require both `tree` and `curl` (review the `./bin/detect` script to see why this works).
59+
Set the `BP_REQUIRES` build-time environment variable to configure the `hello-extensions` buildpack to require both `vim` and `curl` (review the `./bin/detect` script to see why this works).
5860

5961
<!-- test:exec -->
6062
```bash
6163
pack build hello-extensions \
6264
--builder localhost:5000/extensions-builder \
6365
--env BP_EXT_DEMO=1 \
64-
--env BP_REQUIRES=tree,curl \
66+
--env BP_REQUIRES=vim,curl \
6567
--path $PWD/samples/apps/java-maven \
6668
--pull-policy always \
6769
--network host \
@@ -74,29 +76,29 @@ You should see:
7476

7577
```
7678
[detector] ======== Results ========
77-
[detector] pass: samples/tree@0.0.1
79+
[detector] pass: samples/vim@0.0.1
7880
[detector] pass: samples/[email protected]
7981
[detector] pass: samples/[email protected]
8082
[detector] pass: samples/[email protected]
8183
[detector] Resolving plan... (try #1)
8284
[detector] skip: samples/[email protected] provides unused cowsay
8385
[detector] 3 of 4 buildpacks participating
84-
[detector] samples/tree 0.0.1
86+
[detector] samples/vim 0.0.1
8587
[detector] samples/curl 0.0.1
8688
[detector] samples/hello-extensions 0.0.1
87-
[detector] Running generate for extension samples/tree@0.0.1
89+
[detector] Running generate for extension samples/vim@0.0.1
8890
...
8991
[detector] Running generate for extension samples/[email protected]
9092
...
9193
[detector] Checking for new run image
9294
[detector] Found a run.Dockerfile from extension 'samples/curl' setting run image to 'localhost:5000/run-image-curl'
9395
...
94-
[extender (build)] Found build Dockerfile for extension 'samples/tree'
95-
[extender (build)] Applying the Dockerfile at /layers/generated/build/samples_tree/Dockerfile...
96+
[extender (build)] Found build Dockerfile for extension 'samples/vim'
97+
[extender (build)] Applying the Dockerfile at /layers/generated/build/samples_vim/Dockerfile...
9698
...
9799
[extender (build)] Running build command
98100
[extender (build)] ---> Hello Extensions Buildpack
99-
[extender (build)] tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
101+
[extender (build)] VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 19 2023 16:28:36)
100102
...
101103
Successfully built image hello-extensions
102104
```
@@ -114,9 +116,9 @@ You should see something akin to:
114116
curl 7.85.0-DEV (x86_64-pc-linux-musl) ... more stuff here ...
115117
```
116118

117-
What happened: now that `hello-extensions` requires both `tree` and `curl` in its build plan, both extensions are
119+
What happened: now that `hello-extensions` requires both `vim` and `curl` in its build plan, both extensions are
118120
included in the build and provide the needed dependencies for build and launch, respectively
119-
* The `tree` extension installs `tree` at build time, as before
121+
* The `vim` extension installs `vim` at build time, as before
120122
* The `curl` extension switches the run image to `localhost:5000/run-image-curl`, which has `curl` installed
121123

122124
Now our `curl` process can succeed!

content/docs/extension-guide/create-extension/setup-local-environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ We unset any custom lifecycle image that may have been provided to ensure that t
7575
# FIXME: remove branch when https://github.com/buildpacks/samples/pull/149 is merged
7676
git clone https://github.com/buildpacks/samples.git && \
7777
cd samples && \
78-
git fetch origin runext/update-samples && \
78+
git fetch --all && \
7979
git checkout runext/update-samples && \
8080
cd ..
8181
```

content/docs/extension-guide/create-extension/why-dockerfiles.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If the `BP_EXT_DEMO` environment variable is set, the buildpack detects (exits w
3030
cat $PWD/samples/buildpacks/hello-extensions/bin/build
3131
```
3232

33-
The buildpack tries to use `tree` at build-time, and defines a launch process called `curl` that runs `curl --version` at runtime.
33+
The buildpack tries to use `vim` at build-time, and defines a launch process called `curl` that runs `curl --version` at runtime.
3434

3535
### Create a builder with extensions and publish it
3636

@@ -46,15 +46,6 @@ docker run -d --rm -p 5000:5000 registry:2
4646
You can push the builder to any registry of your choice - just ensure that `docker login` succeeds and replace `localhost:5000` in the following examples with your registry namespace -
4747
e.g., `index.docker.io/<username>`.
4848

49-
**Note**: to follow this demo all the way through to the end (including run image extension), you will need a pre-release version of the lifecycle.
50-
* Download the `.tgz` file for your os/arch from the [releases page](https://github.com/buildpacks/lifecycle/releases)
51-
* Add the following lines to `$PWD/samples/builders/alpine/builder.toml`:
52-
53-
```bash
54-
[lifecycle]
55-
uri = <path to .tgz>
56-
```
57-
5849
Create the builder:
5950

6051
<!-- test:exec -->
@@ -85,31 +76,31 @@ You should see:
8576
```
8677
...
8778
[detector] ======== Results ========
88-
[detector] pass: samples/tree@0.0.1
79+
[detector] pass: samples/vim@0.0.1
8980
[detector] pass: samples/[email protected]
9081
[detector] pass: samples/[email protected]
9182
[detector] pass: samples/[email protected]
9283
[detector] Resolving plan... (try #1)
93-
[detector] skip: samples/tree@0.0.1 provides unused tree
84+
[detector] skip: samples/vim@0.0.1 provides unused vim
9485
[detector] skip: samples/[email protected] provides unused curl
9586
[detector] skip: samples/[email protected] provides unused cowsay
9687
[detector] 1 of 4 buildpacks participating
9788
[detector] samples/hello-extensions 0.0.1
9889
...
9990
[extender (build)] Running build command
10091
[extender (build)] ---> Hello Extensions Buildpack
101-
[extender (build)] /cnb/buildpacks/samples_hello-extensions/0.0.1/bin/build: line 6: tree: command not found
92+
[extender (build)] /cnb/buildpacks/samples_hello-extensions/0.0.1/bin/build: line 6: vim: command not found
10293
[extender (build)] ERROR: failed to build: exit status 127
10394
```
10495

105-
What happened: our builder doesn't have `tree` installed, so the `hello-extensions` buildpack failed to build (as it
106-
tries to run `tree --version` in its `./bin/build` script).
96+
What happened: our builder doesn't have `vim` installed, so the `hello-extensions` buildpack failed to build (as it
97+
tries to run `vim --version` in its `./bin/build` script).
10798

108-
Even though there is a `samples/tree` extension that passed detection (`pass: samples/tree@0.0.1`), because
109-
the `hello-extensions` buildpack didn't require `tree` in the build plan, the extension was omitted from the detected
110-
group (`skip: samples/tree@0.0.1 provides unused tree`).
99+
Even though there is a `samples/vim` extension that passed detection (`pass: samples/vim@0.0.1`), because
100+
the `hello-extensions` buildpack didn't require `vim` in the build plan, the extension was omitted from the detected
101+
group (`skip: samples/vim@0.0.1 provides unused vim`).
111102

112-
Let's take a look at how the `samples/tree` extension installs `tree` on the builder image...
103+
Let's take a look at how the `samples/vim` extension installs `vim` on the builder image...
113104

114105
<!--+ if false+-->
115106
---

0 commit comments

Comments
 (0)