The Maven and Gradle plugin documentation shows examples of configuring the Docker host for the image building goal/task to use minikube or podman. We should add documentation for configuring the host to use Colima as well.

The DOCKER_HOST environment variable can be set to the location of the Colima socket. On Linux and macOS this can be done with export DOCKER_HOST=$(docker context inspect colima -f '{{.Endpoints.docker.Host}}').

Configuring the host in the Maven pom.xml would look like this:

<project>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <docker>
                        <host>unix:///${user.home}/.colima/docker.sock</host>
                    </docker>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Configuring the host in the Gradle build.gradle file would look like this:

tasks.named("bootBuildImage") {
  docker {
    host = "unix://${System.properties['user.home']}/.colima/docker.sock"
  }
}

Comment From: misselvexu

Assigne to me .

Comment From: scottfrederick

Thank you @misselvexu. Please let us know if you have any questions.

Comment From: snicoll

@misselvexu how is it going? Are you still interested to contribute?

Comment From: misselvexu

Sure, submit the pr tomorrow and the day after tomorrow.

Comment From: snicoll

@misselvexu hello. Do you still want to contribute?