Using Skaffold with Java

8/3/2018

I was testing Skaffod and It is a great tool for microservices development. But I do not find any tutorial on how to use it with Java. Is there any support to Maven builds?

-- Victor
java
kubernetes
maven
skaffold

2 Answers

12/8/2018

Skaffold now supports JIB out of the box which will be more efficient than multistage Dockerfile building! Check out the JIB Maven example in Skaffold.

-- Balint Pato
Source: StackOverflow

8/3/2018

There is a discussion going on about adding support for Java apps here, you can very much use Docker multistage build with Skaffold. A probably working example is available here

Your build portion of Skaffold file will look something like:

apiVersion: skaffold/v1alpha2
kind: Config
build:
  tagPolicy:
    dateTime:
      format: 2006-01-02_15-04-05.999_MST
      timezone: Local
  artifacts:
  - imageName: <repo>/<image>
    workspace: ./appdir

In the appdir - you can use a multistage Dockerfile and integrate with rest of the workflow. Multistage Dockefile will build artefact in one stage and create a container using the artefact of the first stage.

-- Vishal Biyani
Source: StackOverflow