Search code examples
skaffold

Skaffold not re-build image after code change


skaffold version v1.35.1

Why is Skaffold not re-building image after code change?

I run Skaffold build after code changes. The best would be it it automatically started rebuilding when code changes is made in source code folder.

skaffold.yaml

build:
  artifacts:
    - image: gcr.io/<projectid>/dockerfile-micro-depend
      custom:
        buildCommand: sh buildx.sh
        dependencies:
          paths:
            - buildx.sh
  tagPolicy:
    sha256: {}
  local:
    push: true

Solution

  • custom.dependencies.paths is used to specify the paths to source files within your artifact. By specifying buildx.sh, you're telling Skaffold that the only source file is the buildx.sh script.

    Adding your source directories to the dependencies.path list will do the right thing.