Update the build-image goal to support non-docker environments like podman/buildah.

Objective: I am trying to use the spring-boot:build-image goal to create an image of a sample project.

Expected: Maven to complete successfully with a generated docker image.

Actual: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.3:build-image failed: Connection to the Docker daemon at 'localhost' failed with error "[13] Permission denied"; ensure the Docker daemon is running and accessible:

Notes: I am perfectly capable of building the jar/war myself, writing a dockerfile and using buildah to generate the image. However, the buildpack stuff that has been under development looks very nice and it would be great to be able to use it. My company enforces the use of rootless podman vs docker, and therefore the inclusion of a docker daemon is a non-starter.

Comment From: philwebb

The Spring Boot plugin makes use of Paketo to actually build images. Paketo relies on buildpacks which actually run inside Docker containers themselves. This means that we unfortunately can't run buildpacks without an actual Docker daemon available to do the work.

You might want to look at kpack which allows you to run buildpacks in a Kubernetes cluster.

Comment From: dewthefifth

Thanks for the information and the heads up on kpack! I'll look into it.

Comment From: jam01

@dewthefifth were you able to figure this one out? My org is looking for the exact same thing as you mentioned.

For reference jib does not require docker at all. Unless buildpacks require to run as root we should be able to do the same thing with podman without needing yet another tool like kpack, which in itself requires kubernetes which is no small requirement.