You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/features/dockerfiles.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,24 @@ summary="Dockerfiles can be used to extend base images for buildpacks builds"
5
5
## Why Dockerfiles?
6
6
7
7
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
9
9
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
11
11
isn't always possible. This has been a longstanding source of [discussion](https://github.com/buildpacks/rfcs/pull/173)
12
12
within the CNB project: how can we preserve the benefits of buildpacks while enabling more powerful capabilities?
13
13
14
14
## Buildpacks and Dockerfiles can work together
15
15
16
16
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
19
19
and installing OS-level dependencies for containers. The CNB Dockerfiles feature allows Dockerfiles to "provide"
20
20
dependencies that buildpacks "require" through a shared [build plan][TODO], by introducing the concept of image
21
21
extensions.
22
22
23
23
## What are image extensions?
24
24
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
26
26
Dockerfiles that can be used to extend the builder or run images prior to buildpacks builds. Like buildpacks, extensions
27
27
participate in the `detect` phase - analyzing application source code to determine if they are needed. During `detect`,
28
28
extensions can contribute to the [build plan][TODO] - recording dependencies that they are able to "provide" (though
@@ -54,7 +54,7 @@ at build time.
54
54
55
55
To use image extensions, a platform should do the following:
56
56
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`
58
58
* Include image extensions in the provided builder
59
59
* When invoking the `detector` binary, include image extensions in `order.toml`
60
60
* 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:
67
67
a sub-task of the `extender` and thus happens automatically after (and in the same container as) `extend`
68
68
* Invoke the `exporter` as usual
69
69
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.
72
71
73
72
### Risks
74
73
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
76
75
operators should be mindful that:
77
76
78
77
* 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.
81
79
* When Dockerfiles are used to switch the run image from that defined on the provided builder, the resulting run image
82
80
may not have all the mixins required by buildpacks that detected. Platforms may wish to optionally re-validate mixins
83
81
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
0 commit comments