I'm trying to create a docker image of a Spring Boot application using the Gradle plugin. I'm using Spring Boot 2.6.4 and Gradle 7.1.1.
I'm on a Mac, and I don't have Docker Desktop installed. Indeed, I run docker using Colima.
The problem is that I cannot build the docker image with the command ./gradlew bootBuildImage
since Gradle cannot find the docker daemon:
Connection to the Docker daemon at 'localhost' failed with error "[2] No such file or directory"; ensure the Docker daemon is running and accessible
Is there any configuration I have to do in Colima or my build.gradle
file?
DOCKER_HOST
environment variable set, or adocker.host
configured in the build plugin configuration as shown in the docs (docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/…)? Without this, the plugin should try to connect to the container runtime using the/var/run/docker.sock
socket, which seems like it should work from a quick read of the Colima docs. – Dirty