Skip to content

Commit 56f074b

Browse files
author
Natalie Arellano
committed
Use mounts instead of symlinks to share content
This seems to be the recommended way of doing it with Hugo Also fixes sidebar ordering for Platform Operator section Signed-off-by: Natalie Arellano <[email protected]>
1 parent a2ffcd3 commit 56f074b

File tree

12 files changed

+98
-154
lines changed

12 files changed

+98
-154
lines changed

config.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,23 @@ featureKatacoda = false
9191
[security.http]
9292
methods = ['(?i)GET|POST']
9393
urls = ['.*']
94+
95+
# For more information, see https://gohugo.io/getting-started/directory-structure/#union-file-system
96+
[[module.mounts]]
97+
source = 'content'
98+
target = 'content'
99+
[[module.mounts]]
100+
source = 'content/docs/.concepts/buildpack.md'
101+
target = 'content/docs/for-app-developers/concepts/buildpack.md'
102+
[[module.mounts]]
103+
source = 'content/docs/.concepts/buildpack.md'
104+
target = 'content/docs/for-buildpack-authors/concepts/buildpack.md'
105+
[[module.mounts]]
106+
source = 'content/docs/.concepts/buildpack.md'
107+
target = 'content/docs/for-platform-operators/concepts/buildpack.md'
108+
[[module.mounts]]
109+
source = 'content/docs/.concepts/extension.md'
110+
target = 'content/docs/for-buildpack-authors/concepts/extension.md'
111+
[[module.mounts]]
112+
source = 'content/docs/.concepts/extension.md'
113+
target = 'content/docs/for-platform-operators/concepts/extension.md'

content/docs/.concepts/buildpack.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
+++
2+
title="What is a buildpack?"
3+
weight=1
4+
+++
5+
6+
A `buildpack` is software that transforms application source code into runnable artifacts
7+
by analyzing the code and determining the best way to build it.
8+
9+
<!--more-->
10+
11+
![buildpacks](/images/what.svg)
12+
13+
## Why buildpacks?
14+
15+
Buildpacks allow application developers to focus on what they do best - writing code, without having to worry about image security, optimizing container images, or container build strategy.
16+
17+
How much time have you spent struggling to wrangle yet another Dockerfile? Copying and pasting random Dockerfile snippets into every project? Buildpacks can help! They are a better approach to building container images for applications.
18+
19+
## What do they look like?
20+
21+
Typical buildpacks consist of at least three files:
22+
23+
* `buildpack.toml` -- provides metadata about the buildpack, containing information such as its name, ID, and version.
24+
* `bin/detect` -- performs [detect](#detect).
25+
* `bin/build` -- performs [build](#build).
26+
27+
## How do they work?
28+
29+
![how](/images/how.svg)
30+
31+
**Each buildpack has two jobs to do**
32+
33+
### Detect
34+
35+
The buildpack determines if it is needed or not.
36+
37+
For example:
38+
39+
- A Python buildpack may look for a `requirements.txt` or a `setup.py` file.
40+
- A Node buildpack may look for a `package-lock.json` file.
41+
42+
### Build
43+
44+
The buildpack transforms application source code in some way, for example by
45+
46+
- Setting build-time and run-time environment variables.
47+
- Downloading dependencies.
48+
- Running source code compilation (if needed).
49+
- Configuring the application entrypoint and any startup scripts.
50+
51+
For example:
52+
53+
- A Python buildpack may run `pip install -r requirements.txt` if it detected a `requirements.txt` file.
54+
- A Node buildpack may run `npm install` if it detected a `package-lock.json` file.
Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
+++
3-
title="What are image extensions?"
3+
title="What is an image extension?"
44
aliases=[
55
"/docs/features/dockerfiles"
66
]
77
weight=99
88
+++
99

10-
Image extensions generate Dockerfiles that can be used to extend base images for buildpacks builds.
10+
An `image extension` is software that generates Dockerfiles that can be used to extend base images for buildpacks builds.
1111

1212
<!--more-->
1313

14-
## Why Dockerfiles?
14+
## Why image extensions?
1515

1616
Buildpacks can do a lot, but there are some things buildpacks can't do. They can't install operating system packages,
1717
for example. Why not?
@@ -24,7 +24,7 @@ possible.
2424
This has been a longstanding source of [discussion](https://github.com/buildpacks/rfcs/pull/173) within the CNB project:
2525
how can we preserve the benefits of buildpacks while enabling more powerful capabilities?
2626

27-
## Buildpacks and Dockerfiles can work together
27+
### Buildpacks and Dockerfiles can work together
2828

2929
Buildpacks are often presented as an alternative to Dockerfiles, but we think buildpacks and Dockerfiles can work
3030
together.
@@ -36,20 +36,11 @@ installing OS-level dependencies for containers.
3636
The CNB Dockerfiles feature allows Dockerfiles to "provide" dependencies that buildpacks "require" through a
3737
shared [build plan](/docs/reference/spec/buildpack-api/#build-plan), by introducing the concept of image extensions.
3838

39-
## What are image extensions?
39+
## What do they look like?
4040

4141
Image extensions are buildpack-like components that use a restricted `Dockerfile` syntax to expand base images. Their
4242
purpose is to generate Dockerfiles that can be used to extend the builder or run images prior to buildpacks builds.
4343

44-
Like buildpacks, extensions participate in the `detect` phase - analyzing application source code to determine if they
45-
are needed. During `detect`, extensions can contribute to
46-
the [build plan](/docs/reference/spec/buildpack-api/#build-plan) - recording dependencies that they are able to "
47-
provide" (though unlike buildpacks, they can't "require" anything).
48-
49-
If the provided order contains extensions, the output of `detect` will be a group of image extensions and a group of
50-
buildpacks that together produce a valid build plan. Image extensions only generate Dockerfiles - they don't create
51-
layers or participate in the `build` phase.
52-
5344
An image extension could be defined with the following directory:
5445

5546
```
@@ -60,57 +51,32 @@ An image extension could be defined with the following directory:
6051
│ ├── generate <- similar to a buildpack ./bin/build
6152
```
6253

63-
* The `extension.toml` describes the extension, containing information such as its name, ID, and version.
64-
* `./bin/detect` is invoked during the `detect` phase. It analyzes application source code to determine if the extension
54+
* The `extension.toml` provides metadata about the extension, containing information such as its name, ID, and version.
55+
* `./bin/detect` performs [detect](#detect). It analyzes application source code to determine if the extension
6556
is needed and contributes build plan entries.
66-
* `./bin/generate` is invoked during the `generate` phase (a new lifecycle phase that happens after `detect`). It
57+
* `./bin/generate` performs [generate](#generate) (a new lifecycle phase that happens after `detect`). It
6758
outputs either or both of `build.Dockerfile` or `run.Dockerfile` for extending the builder or run image.
6859

69-
For more information and to see a build in action,
70-
see [authoring an image extension](/docs/for-buildpack-authors/tutorials/basic-extension).
71-
72-
## A platform's perspective
73-
74-
Platforms may wish to use image extensions if they wish to provide the flexibility of modifying base images dynamically
75-
at build time.
76-
77-
### Risks
60+
## How do they work?
7861

79-
Image extensions are considered experimental and susceptible to change in future API versions. However, image extension
80-
should be **used with great care**. Platform operators should be mindful that:
62+
**Each image extension has two jobs to do**
8163

82-
* Dockerfiles are very powerful - in fact, you can do anything with a Dockerfile! Introducing image extensions into your
83-
CNB builds can eliminate the security and compatibility guarantees that buildpacks provide.
84-
* When Dockerfiles are used to switch the run image from that defined on the provided builder, the resulting run image
85-
may not have all the mixins required by buildpacks that detected. Platforms may wish to optionally re-validate mixins
86-
prior to `build` when using extensions.
64+
### Detect
8765

88-
### Putting it all together
66+
The extension determines if it is needed or not.
8967

90-
The ordering of lifecycle phases looks like the following:
91-
92-
* `analyze`
93-
* `detect` - after standard detection, `detect` will also run extensions' `./bin/generate`; output Dockerfiles are
94-
written to a volume
95-
* `restore`
96-
* `extend` - applies one or more `build.Dockerfile`s to the builder image
97-
* `extend` - applies one or more `run.Dockerfile`s to the run image (could run in parallel with builder image extension)
98-
* `build`
99-
* `export`
100-
101-
For more information, consult the [migration guide](/docs/for-platform-operators/how-to/migrate/platform-api-0.9-0.10).
102-
103-
#### Platform support for Dockerfiles
104-
105-
Supported:
68+
Like buildpacks, extensions participate in the `detect` phase - analyzing application source code to determine if they
69+
are needed. During `detect`, extensions can contribute to
70+
the [build plan](/docs/reference/spec/buildpack-api/#build-plan) - recording dependencies that they are able to "
71+
provide" (though unlike buildpacks, they can't "require" anything).
10672

107-
* [pack cli](https://github.com/buildpacks/pack) (prefer version `0.30.0` and above)
73+
If the provided order contains extensions, the output of `detect` will be a group of image extensions and a group of
74+
buildpacks that together produce a valid build plan. Image extensions only generate Dockerfiles - they don't create
75+
layers or participate in the `build` phase.
10876

109-
Needs support:
77+
### Generate
11078

111-
* [Tekton task](https://github.com/tektoncd/catalog/tree/main/task/buildpacks-phases/0.2) ([GitHub issue](https://github.com/tektoncd/catalog/issues/1096))
112-
* [kpack](https://github.com/pivotal/kpack) ([GitHub issue](https://github.com/pivotal/kpack/issues/1047))
79+
The extension outputs Dockerfiles that can be used to extend either or both of the build-time base image and the runtime base image.
11380

114-
Your feedback is appreciated! As the feature evolves, we want to hear from you - what's going well, what's challenging,
115-
and anything else you'd like to see. Please reach out in [Slack](https://cncf.slack.io) (#buildpacks channel)
116-
or [GitHub](https://github.com/buildpacks).
81+
For more information and to see a build in action,
82+
see [authoring an image extension](/docs/for-buildpack-authors/tutorials/basic-extension).

content/docs/for-app-developers/concepts/buildpack.md

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
+++
22
title="How To"
33
weight=3
4-
54
include_summaries=true
65
+++
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
+++
22
title="Concepts"
33
weight=2
4-
54
include_summaries=true
65
+++

content/docs/for-buildpack-authors/concepts/buildpack.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

content/docs/for-buildpack-authors/concepts/extension.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
+++
22
title="How To"
33
weight=3
4-
54
include_summaries=true
65
+++
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
22
title="Concepts"
3-
weight=1
3+
weight=2
44
include_summaries=true
55
+++

0 commit comments

Comments
 (0)