Bazel

Bazel is a fast, scalable, multi-language, and extensible build system.

Skaffold can help build artifacts using Bazel locally; after Bazel finishes building container images, they will be loaded into the local Docker daemon.

Configuration

To use Bazel, bazel field to each artifact you specify in the artifacts part of the build section, and use the build type local. context should be a path containing the bazel files (WORKSPACE and BUILD). The following options can optionally be configured:

Option Description Default
target Required bazel build target to run.
args additional args to pass to bazel build. []

Example

The following build section instructs Skaffold to build a Docker image gcr.io/k8s-skaffold/example with Bazel:

build:
  artifacts:
  - image: gcr.io/k8s-skaffold/example
    bazel:
      target: //:example.tar

Last modified November 6, 2019: re-org with pivot as builder typeS (6cab7f473)