Skip to content

Commit 9651504

Browse files
Natalie ArellanoAidanDelaneyhone
authored
Apply suggestions from code review
Co-authored-by: Aidan Delaney <[email protected]> Co-authored-by: Terence Lee <[email protected]> Signed-off-by: Natalie Arellano <[email protected]>
1 parent 698734e commit 9651504

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

content/docs/features/dockerfiles.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ summary="Dockerfiles can be used to extend base images for buildpacks builds"
55
## Why Dockerfiles?
66

77
Buildpacks can do a lot, but there are some things buildpacks can't do. They can't install operating system packages,
8-
for example. Why not? Buildpacks run unprivileged and cannot make arbitrary changes to the filesystem. This enhances
8+
for example. Why not? Buildpacks run unprivileged (i.e buildpacks do not run as the `root` user) and cannot make arbitrary changes to the filesystem. This enhances
99
security, enables buildpack interoperability, and preserves the ability to rebase - but it comes at a cost. Base image
10-
authors must anticipate the OS-level dependencies that will be needed at build- and run-time ahead of time, and this
10+
authors must anticipate the OS-level dependencies that will be needed at build and run-time ahead of time, and this
1111
isn't always possible. This has been a longstanding source of [discussion](https://github.com/buildpacks/rfcs/pull/173)
1212
within the CNB project: how can we preserve the benefits of buildpacks while enabling more powerful capabilities?
1313

1414
## Buildpacks and Dockerfiles can work together
1515

1616
Buildpacks are often presented as an alternative to Dockerfiles, but we think buildpacks and Dockerfiles can work
17-
together. Whereas buildpacks are optimized for creating layers that are efficient and logically mapped to the
18-
dependencies that they provide, Dockerfiles are the most-used and best-understood mechanism for constructing base images
17+
together. Buildpacks are optimized for creating layers that are efficient and logically mapped to the
18+
dependencies that they provide. By contrast, Dockerfiles are the most-used and best-understood mechanism for constructing base images
1919
and installing OS-level dependencies for containers. The CNB Dockerfiles feature allows Dockerfiles to "provide"
2020
dependencies that buildpacks "require" through a shared [build plan][TODO], by introducing the concept of image
2121
extensions.
2222

2323
## What are image extensions?
2424

25-
Image extensions are somewhat like buildpacks, although they are also very different. Their purpose is to generate
25+
Image extensions are buildpack-like components that use a restricted `Dockerfile` syntax to expand base images. Their purpose is to generate
2626
Dockerfiles that can be used to extend the builder or run images prior to buildpacks builds. Like buildpacks, extensions
2727
participate in the `detect` phase - analyzing application source code to determine if they are needed. During `detect`,
2828
extensions can contribute to the [build plan][TODO] - recording dependencies that they are able to "provide" (though
@@ -54,7 +54,7 @@ at build time.
5454

5555
To use image extensions, a platform should do the following:
5656

57-
* Ensure the platform API in use is at least `0.10`
57+
* Ensure the platform API in use is at least `0.10`; image extensions were introduced in API version `0.10`
5858
* Include image extensions in the provided builder
5959
* When invoking the `detector` binary, include image extensions in `order.toml`
6060
* Note that the new `generate` phase is a sub-task of the `detector` and thus happens automatically after (and in the
@@ -67,17 +67,15 @@ To use image extensions, a platform should do the following:
6767
a sub-task of the `extender` and thus happens automatically after (and in the same container as) `extend`
6868
* Invoke the `exporter` as usual
6969

70-
Extensions workflows are not currently supported when using the `creator` binary - support may be added in the future,
71-
but with a lower priority.
70+
Extensions workflows are not currently supported when using the `creator` binary - support may be added in the future.
7271

7372
### Risks
7473

75-
Image extensions are considered experimental and susceptible to change in future API versions. Additionally, platform
74+
Image extensions are considered experimental and susceptible to change in future API versions. However, image extension should be **used with great care**. Platform
7675
operators should be mindful that:
7776

7877
* Dockerfiles are very powerful - in fact, you can do anything with a Dockerfile! Introducing image extensions into your
79-
CNB builds can eliminate the security and compatibility guarantees that buildpacks provide if not done with great
80-
care.
78+
CNB builds can eliminate the security and compatibility guarantees that buildpacks provide.
8179
* When Dockerfiles are used to switch the run image from that defined on the provided builder, the resulting run image
8280
may not have all the mixins required by buildpacks that detected. Platforms may wish to optionally re-validate mixins
8381
prior to `build` when using extensions.
@@ -134,7 +132,7 @@ the builder image, and switches the run image to an image that has `curl` instal
134132
### 2. Clone the samples repo
135133

136134
* `cd $workspace`
137-
* `git clone git@github.com:buildpacks/samples.git`
135+
* `git clone https://github.com/buildpacks/samples.git`
138136
* `cd samples`
139137
* `git checkout extensions-phase-2` (TODO: remove when `extensions-phase-2` merged)
140138

0 commit comments

Comments
 (0)