<p>I'm trying to use Skaffold, Dekorate and Spring Boot.</p>
<p>I can't find any examples using the new buildpack feature of Spring Boot 2.3+</p>
<pre><code>apiVersion: skaffold/v2beta9
kind: Config
metadata:
  name: tellus-upgrade
build:
  artifacts:
    - image: tellus-admin
      custom:
        buildCommand: ./mvnw -pl tellus-admin org.springframework.boot:spring-boot-maven-plugin:2.4.0:build-image -Dspring-boot.build-image.imageName=$IMAGE -Drevision=dev-SNAPSHOT -DskipTests=true
        dependencies:
          paths:
            - tellus-admin/src
            - tellus-admin/pom.xml
    - image: tellus-config-server
      custom:
        buildCommand: ./mvnw -pl tellus-config-server org.springframework.boot:spring-boot-maven-plugin:2.4.0:build-image -Dspring-boot.build-image.imageName=$IMAGE -Drevision=dev-SNAPSHOT -DskipTests=true
        dependencies:
          paths:
            - tellus-config-server/src
            - tellus-config-server/pom.xml
deploy:
  kubectl:
    manifests:
    - kubernetes/defaults.yml
    - kubernetes/db/kubernetes.yml
    - kubernetes/dev/dnsutils.yml
    - kubernetes/kafka-connect/kubernetes.yml
    - tellus-admin/target/classes/META-INF/dekorate/kubernetes.yml
    - tellus-config-server/target/classes/META-INF/dekorate/kubernetes.yml
</code></pre>
<p>When I run skaffold dev I get the error:
exiting dev mode because first build failed: the custom script didn't produce an image with tag [tellus-config-server:RELEASE_2020_2_0-226-g9be76a373-dirty]</p>
<p>However from the logs it looks like the image was built...</p>
<pre><code>[INFO] Successfully built image 'docker.io/library/tellus-config-server:RELEASE_2020_2_0-226-g9be76a373-dirty'
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.004 s
[INFO] Finished at: 2020-11-15T22:31:59+11:00
[INFO] ------------------------------------------------------------------------
Building [tellus-admin]...
exiting dev mode because first build failed: the custom script didn't produce an image with tag [tellus-config-server:RELEASE_2020_2_0-226-g9be76a373-dirty]
</code></pre>

<p>The <code>spring-boot-maven-plugin:build-image</code> loads the image into your local Docker daemon, but does not push the image.  I've never tried it, but you might be able to use the <code>com.spotify:dockerfile-maven-plugin:push</code> goal.</p>
<p><em>Update</em>: here's a Skaffold custom build script that should do the right thing:</p>
<pre><code>#!/bin/sh
set -e
cd &quot;$BUILD_CONTEXT&quot;
mvn -pl &quot;$1&quot; -Drevision=dev-SNAPSHOT -DskipTests=true \
  org.springframework.boot:spring-boot-maven-plugin:build-image \
  -Dspring-boot.build-image.imageName=&quot;$IMAGE&quot;
if [ &quot;$PUSH_IMAGE&quot; = true ]; then
    docker push &quot;$IMAGE&quot;
fi
</code></pre>
<p>You could save that to a file <code>mvn-build-image.sh</code> and then modify your skaffold.yaml like:</p>
<pre><code>artifacts:
- image: tellus-admin
  custom:
    buildCommand: ./mvn-build-image.sh tellus-admin 
</code></pre>
<hr />
<p>You might want to look at the <a href="https://skaffold.dev/docs/pipeline-stages/builders/jib/" rel="nofollow noreferrer">Skaffold's Jib integration</a> to simplify this process.</p>
