@@ -9,41 +9,60 @@ Let's see a build that requires base image extension in order to succeed.
9
9
10
10
#### detect
11
11
12
- * ` cat $workspace/samples/buildpacks/hello-extensions/bin/detect ` - the buildpack always detects but doesn't require any
13
- dependencies (as the output build plan is empty)
12
+ ` cat $workspace/samples/buildpacks/hello-extensions/bin/detect ` - the buildpack always detects but doesn't require any
13
+ dependencies (as the output build plan is empty)
14
14
15
15
#### build
16
16
17
- * ` cat $workspace/samples/buildpacks/hello-extensions/bin/build ` - the buildpack tries to use ` tree ` during the build
18
- phase, and defines a launch process called ` curl ` that runs ` curl --version ` at runtime
17
+ ` cat $workspace/samples/buildpacks/hello-extensions/bin/build ` - the buildpack tries to use ` tree ` during the build
18
+ phase, and defines a launch process called ` curl ` that runs ` curl --version ` at runtime
19
19
20
20
### Create a builder with extensions and publish it
21
21
22
- * Ensure experimental features are enabled: ` $workspace/pack/out/pack config experimental true `
23
- * Download the latest lifecycle tarball from the GitHub release
24
- page: https://github.com/buildpacks/lifecycle/releases/tag/v0.15.0-rc.1 (FIXME: update to 0.15.0 when released)
25
- * Edit ` $workspace/samples/builders/alpine/builder.toml ` to add the following at the end of the file:
22
+ 1 . Ensure experimental features are enabled: ` $workspace/pack/out/pack config experimental true `
23
+
24
+ 2 . Download the latest lifecycle tarball from the GitHub release
25
+ page: https://github.com/buildpacks/lifecycle/releases/tag/v0.15.0-rc.1 (FIXME: update to 0.15.0 when released)
26
+
27
+ 3 . Edit ` $workspace/samples/builders/alpine/builder.toml ` to add the following at the end of the file:
26
28
27
29
```
28
30
[lifecycle]
29
31
uri = <path to lifecycle tarball in previous step>
30
32
```
31
33
32
- * Ensure you are authenticated with an OCI registry: ` docker login ` should succeed
33
- * Set your preferred registry namespace: ` registry_namespace=<your preferred registry namespace> `
34
- * For now, it is necessary for the builder to be pushed to a registry for ` pack build ` with image extensions to
35
- succeed
36
- * ` $workspace/pack/out/pack builder create $registry_namespace/extensions-builder --config $workspace/samples/builders/alpine/builder.toml --publish `
34
+ 4 . Ensure you are authenticated with an OCI registry: ` docker login ` should succeed
35
+
36
+ 5 . Set your preferred registry namespace: ` registry_namespace=<your preferred registry namespace> `
37
+ * For now, it is necessary for the builder to be pushed to a registry for builds with image extensions to succeed
38
+
39
+ 6 . Create the builder:
40
+
41
+ ```
42
+ $workspace/pack/out/pack builder create $registry_namespace/extensions-builder \
43
+ --config $workspace/samples/builders/alpine/builder.toml \
44
+ --publish
45
+ ```
37
46
38
47
### See a build in action (build failure case)
39
48
40
- * Ensure experimental features are enabled: ` $workspace/pack/out/pack config experimental true `
41
- * Set the lifecycle image for ` pack ` to use in the untrusted builder workflow (as the trusted workflow that uses
42
- the ` creator ` is not currently supported): ` LIFECYCLE_IMAGE=buildpacksio/lifecycle:0.15.0-rc.1 ` (FIXME: update to
43
- 0.15.0 when released)
44
- * Build the application image (note that the "source" directory is effectively ignored in our
45
- example): ` $workspace/pack/out/pack build hello-extensions --builder $registry_namespace/extensions-builder --lifecycle-image $LIFECYCLE_IMAGE --verbose --pull-policy always `
46
- - you should see:
49
+ 1 . Ensure experimental features are enabled: ` $workspace/pack/out/pack config experimental true `
50
+
51
+ 2 . Set the lifecycle image for ` pack ` to use in the untrusted builder workflow (as the trusted workflow that uses
52
+ the ` creator ` is not currently supported): ` LIFECYCLE_IMAGE=buildpacksio/lifecycle:0.15.0-rc.1 ` (FIXME: update to
53
+ 0.15.0 when released)
54
+
55
+ 3 . Build the application image (note that the "source" directory is effectively ignored in our example):
56
+
57
+ ```
58
+ $workspace/pack/out/pack build hello-extensions \
59
+ --builder $registry_namespace/extensions-builder \
60
+ --lifecycle-image $LIFECYCLE_IMAGE \
61
+ --pull-policy always \
62
+ --verbose
63
+ ```
64
+
65
+ You should see:
47
66
48
67
```
49
68
[detector] ======== Results ========
@@ -60,11 +79,14 @@ uri = <path to lifecycle tarball in previous step>
60
79
[extender] ERROR: failed to build: exit status 127
61
80
```
62
81
63
- * What happened: our builder doesn't have ` tree ` installed, so the ` hello-extensions ` buildpack failed to build (as it
64
- tries to run ` tree --version ` in its ` ./bin/build ` script). Even though there is a ` samples/tree ` extension that
65
- passed detection (
` pass: samples/[email protected] ` ), because the
` hello-extensions ` buildpack didn't require
` tree ` in the
66
- build plan, the extension was omitted from the detected group (
` skip: samples/[email protected] provides unused tree ` ). Let's
67
- take a look at what the ` samples/tree ` extension does...
82
+ What happened: our builder doesn't have ` tree ` installed, so the ` hello-extensions ` buildpack failed to build (as it
83
+ tries to run ` tree --version ` in its ` ./bin/build ` script).
84
+
85
+ * Even though there is a
` samples/tree ` extension that passed detection (
` pass: samples/[email protected] ` ), because
86
+ the ` hello-extensions ` buildpack didn't require ` tree ` in the build plan, the extension was omitted from the detected
87
+ group (
` skip: samples/[email protected] provides unused tree ` ).
88
+
89
+ Let's take a look at how the ` samples/tree ` extension installs ` tree ` on the builder image...
68
90
69
91
<!-- + if false+-->
70
92
---
0 commit comments