Skip to content

Commit

Permalink
Merge pull request #3199 from dgageot/more-buildpacks-doc
Browse files Browse the repository at this point in the history
[Doc] Buildpacks
  • Loading branch information
balopat committed Nov 7, 2019
2 parents e8817b9 + 73d91f1 commit f12e9f9
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 17 deletions.
1 change: 1 addition & 0 deletions docs/content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Skaffold supports the following tools:
- locally
- on cloud with [Google Cloud Build](https://cloud.google.com/cloud-build/docs/)
* [Bazel](https://bazel.build/) locally
* [Cloud Native Buildpacks](https://buildpacks.io/) locally
* Custom script locally
{{% /tab %}}

Expand Down
1 change: 1 addition & 0 deletions docs/content/en/docs/design/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ provides built-in support for the following tools:
* Dockerfile locally, in-cluster with kaniko or on cloud using Google Cloud Build
* Jib Maven and Jib Gradle locally or on cloud using Google Cloud Build
* Bazel locally
* Cloud Native Buildpacks locally
* Custom script locally
* **Test**
* [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test)
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/pipeline-stages/builders/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Skaffold has native support for several different tools for building images:
- [locally]({{< relref "/docs/pipeline-stages/builders/jib#jib-maven-and-gradle-locally" >}})
- on cloud with [Google Cloud Build]({{< relref "/docs/pipeline-stages/builders/jib#remotely-with-google-cloud-build" >}})
* [Bazel]({{< relref "/docs/pipeline-stages/builders/bazel" >}}) locally
* [Cloud Native Buildpacks]({{< relref "/docs/pipeline-stages/builders/buildpacks" >}}) locally
* [Custom script] ({{< relref "/docs/pipeline-stages/builders/custom" >}})
- [locally]({{<relref "/docs/pipeline-stages/builders/custom#custom-build-script-locally" >}}) and
- [in cluster]({{<relref "/docs/pipeline-stages/builders/custom#custom-build-script-in-cluster" >}})
* [CNCF Buildpacks] ({{< relref "/docs/pipeline-stages/builders/buildpacks" >}})

The `build` section in the Skaffold configuration file, `skaffold.yaml`,
controls how artifacts are built. To use a specific tool for building
Expand Down
55 changes: 41 additions & 14 deletions docs/content/en/docs/pipeline-stages/builders/buildpacks.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,66 @@
---
title: "CNCF Buildpacks"
title: "Cloud Native Buildpacks"
linkTitle: "Buildpacks"
weight: 50
featureId: build.buildpacks
---

[Buildpacks]((https://buildpacks.io/)) enable building language-based containers from source code, without the need for a Dockerfile.
[Cloud Native Buildpacks](https://buildpacks.io/) enable building language-based
containers from source code, without the need for a Dockerfile.

Skaffold supports building with buildpacks natively.

Skaffold buildpacks support, builds the image inside local docker daemon.
It mounts the source dependencies and local artifact cache if caching is enabled
to a container in a docker daemon. These get unmounted once the build process is finished.
Skaffold supports building with Buildpacks natively, without installing
additional software. However, Buildpacks require a local Docker daemon
to be used.

Once all the necessary data is present, Skaffold wil build inside a container in a docker daemon
with image specified in `builderImage` in the `buildpack` config.
Once all the necessary data is present, Skaffold will build inside a container,
with the local Docker daemon, with ther builder image specified in `builder`,
in the `buildpack` config.

On successful build completion, built images will be pushed to the remote registry. You can choose to skip this step.
On successful build completion, built images will be pushed to the remote registry.
You can choose to skip this step.


**Configuration**
### Configuration

To use Buildpacks, add a `buildpack` field to each artifact you specify in the
`artifacts` part of the `build` section. `context` should be a path to
your source.
your sources.

The following options can optionally be configured:

{{< schema root="BuildpackArtifact" >}}

`builder` is *required* and tells Skaffold which
[Builder](https://buildpacks.io/docs/app-developer-guide/build-an-app/) to use.

**Example**

The following `build` section, instructs Skaffold to build a
Docker image `gcr.io/k8s-skaffold/skaffold-buildpacks` with buildpacks:
Docker image with buildpacks:

{{% readfile file="samples/builders/buildpacks.yaml" %}}

### Dependencies

`dependencies` tells the skaffold file watcher which files should be watched to
trigger rebuilds and file syncs. Supported schema for `dependencies` includes:

{{< schema root="BuildpackDependencies" >}}

By default, every file in the artifact's `context` will be watched.

#### Paths and Ignore

`Paths` and `Ignore` are arrays used to list dependencies.
Any paths in `Ignore` will be ignored by the skaffold file watcher, even if they are also specified in `Paths`.
`Ignore` will only work in conjunction with `Paths`, and with none of the other custom artifact dependency types.

```yaml
buildpack:
builder: "heroku/buildpacks"
dependencies:
paths:
- pkg/**
- src/*.go
ignore:
- vendor/**
```
4 changes: 2 additions & 2 deletions docs/data/maturity.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"build.buildpacks": {
"build": "x",
"area": "Build",
"feature": "native buildpacks support",
"feature": "Cloud Native Buildpacks support",
"maturity": "alpha",
"description": "Skaffold natively support for buildpacks artifact and buildpacks builder "
"description": "Skaffold natively support for artifacts built with Cloud Native Buildpacks"
},
"build.custom": {
"dev": "x",
Expand Down

0 comments on commit f12e9f9

Please sign in to comment.