<p>SpringBoot 2.3 introduced a feature to create OCI/Docker images by running <code>./gradlew bootBuildImage</code> instead of having a <code>Dockerfile</code> and execute <code>docker build .</code></p>

<p>When building on a Gitlab build server that is running inside a Kubernetes cluster there is no Docker daemon available though (no docker-in-docker service for security reasons). Instead images have to be build and uploaded using Google's "Kaniko" tool.</p>

<p>Is it possible to combine both somehow i.e. use "bootBuildImage" without a running Docker daemon?</p>

lathspell
<p>It is possible by using <a href="https://podman.io/" rel="nofollow noreferrer">Podman</a>. Podman includes a daemon that implements a Docker-compatible API. On a local machine this can be started via <code>podman system service --time 0 tcp://0.0.0.0:2375</code>.</p>
<p>When running in Kubernetes (or generally in a container) you can use the container image from Quay: <code>quay.io/containers/podman</code>. Start the service in the background and the run your build. Something like this should work:</p>
<pre class="lang-yaml prettyprint-override"><code>build:
  image: my-java-builder
  services:
    - name: quay.io/containers/podman:v4.2.1
      alias: docker
      command: [&quot;podman&quot;, &quot;system&quot;, &quot;service&quot;, &quot;--time=0&quot;, &quot;tcp://0.0.0.0:2375&quot;]
  variables:
    DOCKER_HOST: tcp://docker:2375
  script:
    - ./gradlew bootBuildImage
</code></pre>
