We have verified that our DOCKER_HOST is unix:///run/docker/docker.sock.

Yet BuildBootImage still tries to use /var/run/docker.sock despite we've clearly set the configuration in our build.gradle.kts as well:

tasks.withType<BootBuildImage> {
    pullPolicy = PullPolicy.IF_NOT_PRESENT
    imageName = "***.io/***/***:${project.version}"
    docker {
        host.set("unix:///run/docker/docker.sock")
    }
}

logs:

Downloading https://services.gradle.org/distributions/gradle-8.5-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%

Welcome to Gradle 8.5!

Here are the highlights of this release:
 - Support for running on Java 21
 - Faster first use with Kotlin DSL
 - Improved error and warning messages

For more details see https://docs.gradle.org/8.5/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :checkKotlinGradlePluginConfigurationErrors
> Task :compileKotlin
> Task :processResources
> Task :compileJava NO-SOURCE
> Task :classes
> Task :resolveMainClassName
> Task :bootJar

> Task :bootBuildImage
Building image '***.***.io/***/***:14.1.2024-01-19.819e876'

 > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' ..................................................
 > Pulled builder image 'paketobuildpacks/builder-jammy-base@sha256:928[11](https://github.com/***/***/actions/runs/***/job/***#step:7:12)b61280[13](https://github.com/***/***/actions/runs/***/job/***#step:7:14)0099527b40c7650c871187a7e1cebb21744d93e480fc34cbcb0'
 > Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' ..................................................
 > Pulled run image 'paketobuildpacks/run-jammy-base@sha256:53460f911ac95469e4a796555d8c49f7c70d61caa6c120a1b7eb07248986d52a'
 > Executing lifecycle version v0.18.4
 > Using build cache volume 'pack-cache-ca233e155[14](https://github.com/***/***/actions/runs/***/job/***#step:7:15)4.build'

 > Running creator
    [creator]     ERROR: failed to initialize docker client: failed to connect to docker socket: dial unix /var/run/docker.sock: connect: connection refused

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
6 actionable tasks: 6 executed
> Builder lifecycle 'creator' failed with status code 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org./

BUILD FAILED in 3m 5s

Comment From: scottfrederick

Running creator [creator] ERROR: failed to initialize docker client: failed to connect to docker socket: dial unix /var/run/docker.sock: connect: connection refused

This message is coming from a builder process running inside a Docker container, not from the Spring Boot plugin code. This builder process uses /var/run/docker.sock by default. As described in the documentation, you can set a docker.bindHostToBuilder property in your build configuration to cause the builder process in the container to use the same Docker host address that the Spring Boot build plugin is using.

If you are using a Docker deamon other than Docker Engine or Docker Desktop, the documentation includes examples of configuring the plugins for those daemons.

Please let us know if that solves your problem.

Comment From: testersen

I will try this out in the next couple of hours! I'll give feedback once I'm back at my laptop :)

Thanks for a quick response, and links to the documentation! <3

Comment From: testersen

Binding to docker host worked very well! Thank you! :)