Cloud Native Buildpacks  alpha 

Cloud Native Buildpacks enable building a container image from source code without the need for a Dockerfile.

Skaffold supports building with Cloud Native Buildpacks, requiring only a local Docker daemon. Skaffold performs the build inside a container using the builder specified in the buildpack config.

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

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.

The following options can optionally be configured:

Option Description Default
forcePull should the builder image be pull before each build. false
builder Required builder image used.
runImage overrides the stack’s default run image.
dependencies file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.

builder is required and tells Skaffold which Builder to use.

Example

The following build section, instructs Skaffold to build a Docker image with buildpacks:

apiVersion: skaffold/v1
kind: Config
build:
  artifacts:
  - image: gcr.io/k8s-skaffold/skaffold-buildpacks
    buildpack:
      builder: "heroku/buildpacks"

Dependencies

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

Option Description Default
paths should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization. []
ignore specifies the paths that should be ignored by skaffold’s file watcher. If a file exists in both paths and in ignore, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with paths. []

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.

buildpack:
  builder: "heroku/buildpacks"
  dependencies:
    paths:
    - pkg/**
    - src/*.go
    ignore:
    - vendor/**

Limitations

The container images produced by Cloud Native Buildpacks cannot be configured by skaffold debug for debugging. These images use a launcher binary as an entrypoint to run commands that are specified in a set of configuration files, which cannot be altered by debug.

Last modified November 7, 2019: incorrect merge (ef31246e0)