Local build
Local build execution is the default execution context. Skaffold will use your locally-installed build tools (such as Docker, Bazel, Maven or Gradle) to execute the build.
Configuration
To configure the local execution explicitly, add build type local
to the build section of skaffold.yaml
build:
local: {}
The following options can optionally be configured:
Option | Description | Default |
---|---|---|
push |
should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster. |
|
tryImportMissing |
whether to attempt to import artifacts from Docker (either a local or remote registry) if not in the cache. | false |
useDockerCLI |
use docker command-line interface instead of Docker Engine APIs. |
false |
useBuildkit |
use BuildKit to build Docker images. If unspecified, uses the Docker default. |
|
concurrency |
how many artifacts can be built concurrently. 0 means “no-limit”. | 1 |
Faster builds
There are a few options for achieving faster local builds.
Avoiding pushes
When deploying to a local cluster,
Skaffold defaults push
to false
to speed up builds. The push
setting can be set from the command-line with --push
.
Parallel builds
The concurrency
controls the number of image builds that are run in parallel.
Skaffold disables concurrency by default for local builds as several
image builder types (custom
, jib
) may change files on disk and
result in side-effects.
concurrency
can be set to 0
to enable full parallelism, though
this may consume significant resources.
The concurrency setting can be set from the command-line with the
--build-concurrency
flag.
When artifacts are built in parallel, the build logs are still printed in sequence to make them easier to read.
Build avoidance with tryImportMissing
tryImportMissing: true
causes Skaffold to avoid building an image when
the tagged image already exists in the destination. This setting can be
useful for images that are expensive to build.
tryImportMissing
is disabled by default to avoid the risk from importing
a stale image, where the imported image is different from the image
that would have been built from the artifact source.
tryImportMissing
is best used with a
tagging policy such as
imageDigest
or gitCommit
’s TreeSha
or AbbrevTreeSha
variants,
where the tag is computed using the artifact’s contents.