AzureDevops Pipeline build dockerApiVersion 1.24

Hi. I’m having an issue for like, five days straight right now.
This is the issue I’m getting when I try to maven build during my pipeline:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.10:build-image (default-cli) on project srg-fornitura-core: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.10:build-image failed: Docker API call to '/var/run/docker.sock/v1.24/images/create?fromImage=docker.io%2Fpaketobuildpacks%2Fbuilder-jammy-base%3Alatest' failed with status code 400 "Bad Request" and message "client version 1.24 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version" -> [Help 1]

Giving you context, im using springboot for building the docker image, and i tried everything like, overwriting the docker version, but it doesn’t overwrite it.

Updating my spring version over the 3.3.10 is kinda hard right now, it affects too much my code and I don’t have the time to fix it.

If you don’t want to update the Spring version to use a newer API, the other option is to downgrade Docker or use the method recommended by @meyay

I think it was also overridable in the Docker daemon config file, but I could not find that post.

And I can do it in AzureDevops? We’re talking in enterprise environment, so idk if I can lower the api version like that

I don’t know. I haven’t used Azure Devops for this yet. I guess it depends on how the daemon is is running. If there is no other way, you could try running another Docker daemon for the pipeline in a Docker container (Docker in Docker) I’m sure we have users working with Azure Devops and I hope they find this topic, but you cold have better luck on a Microsoft forum where they can help you better with Microsoft products and how Azure Devops could be configured.

Eventually you will need to upgrade the client app as well.

The docker sdk used in this version of in org.springframework.boot:spring-boot-maven-plugin:3.3.10 is outdated and will not work with Docker v29.

It can be set on Docker Engine level: https://www.docker.com/blog/docker-engine-version-29/#minimum-api-version-update. Not sure if and how this can be done in AZDO, though.

If it’s not possible, you could try to find out which docker client dependent exactly they use, and check if it allows setting the api version in a property file. For instance, if they use com.github.docker-java:docker-java-core, you could create a property like described here.

Update: You could also try if adding export DOCKER_API_VERSION=1.44 to your shell or bash block, a line before the line with themvn or mvnw command, is respected by the docker client they use.

Assuming you have something like this in your pipeline steps:

- bash: |
    mvn .....

You would use

- bash: |
    export DOCKER_API_VERSION=1.44
    mvn .....

we don’t use bash or mvn command, but using -task : ecc
maybe in the task: Maven@3 ? I guess

I have no idea. I don’t use AZDO. I just googled how steps look like in Azure Devops and shared an example of how it could be done.

I tried something but it didn’t worked. My coworker solved it like 2 hours ago, but with the docker file into the root of the file. I think we’ll plan for the future the upgrade of springboot, I guess