Init  alpha 

skaffold init is an easy way to get your project up and running in seconds.

Skaffold auto-generates build and deploy config for supported builders and deployers.

Build Config Initialization

skaffold init currently supports build detection for two builders.

  1. Docker
  2. Jib

skaffold init will walk your project directory and look for any Dockerfiles or build.gradle/pom.xml. Please note, skaffold init skips files that are larger than 500MB.

If you have multiple Dockerfile or build.gradle/pom.xml files, Skaffold will provide an option to pair an image with one of the file.

E.g. For a multi-services microservices example

skaffold init


skaffold init also recognizes a maven or gradle project and will auto-suggest jib builder. Currently jib artifact detection is disabled by default, you can turn it on using the flag --XXenableJibInit.

You can try it this out on example jib project

skaffold init --XXenableJibInit


In case you want to configure build artifacts on your own, use --skip-build flag.

Deploy Config Initialization

skaffold init currently supports only kubectl deployer Skaffold will walk through all the yaml files in your project and find valid kubernetes manifest files.

These files will be added to deploy config in skaffold.yaml.

    - leeroy-app/kubernetes/deployment.yaml
    - leeroy-web/kubernetes/deployment.yaml

Init API

skaffold init also exposes an api which tools like IDEs can integrate with via flags.

This API can be used to

  1. Analyze a project workspace and discover all build definitions (e.g. Dockerfiles) and artifacts (image names from the Kubernetes manifests) - this then provides an ability for tools to ask the user to pair the artifacts with Dockerfiles interactively.
  2. Given a pairing between the image names (artifacts) and build definitions (e.g. Dockerfiles), generate Skaffold build config for a given artifact.

Init API contract

API flag input/output
Analyze --analyze json encoded output of builders and images
Generate --artifact = delimited” build definition/image pair (for example: =path1/Dockerfile=artifact1) or
JSON string (for example: {"builder":"Docker","payload":{"path":"Dockerfile"},"image":"artifact")

Analyze API

Analyze API walks through all files in your project workspace and looks for Dockerfile files.

To get all image names and dockerfiles, run

skaffold init --analyze | jq

will give you a json output

  "dockerfiles": [
  "images": [

Generate API

To generate a skaffold build config, use the --artifact flag per artifact.

For multiple artifacts, use --artifact multiple times.

microservices$skaffold init \
  -a '{"builder":"Docker","payload":{"path":"leeroy-app/Dockerfile"},"image":""}' \
  -a '{"builder":"Docker","payload":{"path":"leeroy-web/Dockerfile"},"image":""}'

will produce an skaffold.yaml config like this

apiVersion: skaffold/v1
kind: Config
  name: microservices
  - image:
    context: leeroy-app
  - image:
    context: leeroy-web
    - leeroy-app/kubernetes/deployment.yaml
    - leeroy-web/kubernetes/deployment.yaml