<p>Assuming I have the following <code>skaffold.yaml</code></p>
<pre><code>apiVersion: skaffold/v2beta12
kind: Config
metadata:
  name: myapp
build:
  local:
    push: true
  artifacts:
  - image: pkaramol/my-image
    docker:
      dockerfile: Dockerfile
deploy:
  helm:
    releases:
      - name: myapp
        chartPath: charts
  kubectl:
    manifests:
       - ./k8s/*
</code></pre>
<p>How can I instruct <code>skaffold</code> to avoid uploading (and then downloading) <code>pkaramol/myimage</code> to dockerhub but rather build it locally and using it directly within the cluster I am connected to?</p>

<p>You can instruct Skaffold to build the image locally by using the <code>local</code> build mode in the <code>build</code> section of the skaffold.yaml file, like this:</p>
<pre><code>apiVersion: skaffold/v2beta12
kind: Config
metadata:
  name: myapp
build:
  local:
    push: false
  artifacts:
  - image: pkaramol/my-image
    docker:
      dockerfile: Dockerfile
deploy:
  helm:
    releases:
      - name: myapp
        chartPath: charts
  kubectl:
    manifests:
       - ./k8s/*
</code></pre>
<p>The <code>push</code> parameter should be set to <code>false</code> to prevent Skaffold from uploading the image to a registry. This will tell Skaffold to build the image locally and use it directly in the cluster that you are connected to.</p>
