Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower the minimum version of Docker required for building images to v1.24 #19945

Closed
AlexFalappa opened this issue Jan 27, 2020 · 7 comments
Closed
Labels
type: enhancement A general enhancement
Milestone

Comments

@AlexFalappa
Copy link
Contributor

Using the new Spring Boot maven plugin goal spring-boot:build-image I faced the following build failure:

Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.3.0.M1:build-image failed: Docker API call to 'docker://localhost/v1.40/images/create?fromImage=docker.io%2Fcloudfoundry%2Fcnb%3A0.0.43-bionic' failed with status code 400 "Bad Request"

According to the Docker API version matrix it seems at least Docker v19.03 is needed (implementing API version 1.40) while I currently am on Docker v18.09 which implements API version 1.39.

Is the very latest version of Docker really needed to build OCI images?

Please consider supporting a wider range of Docker versions or otherwise explicitly document the minimum Docker version needed.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 27, 2020
@AlexFalappa
Copy link
Contributor Author

Had a look at the commits history and noticed the API version was hardcoded in
spring-boot-project/spring-boot-tools/spring-boot-cloudnativebuildpack/src/main/java/org/springframework/boot/cloudnativebuildpack/docker/DockerApi.java.

According to Docker API documentation version less API URLs are deprecated but should anyway be possible to use a lower version since newer daemons will be retro compatible.

@wilkinsona wilkinsona changed the title Support more Docker installations Lower the minimum version of Docker required for building images Jan 30, 2020
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 30, 2020
@wilkinsona wilkinsona added this to the 2.3.x milestone Jan 30, 2020
@wilkinsona
Copy link
Member

We don't use much of the Docker API at all so our required version could certainly be lower. The question is how much lower should it be. At the time of writing, the documentation says the following:

Docker does not recommend running versions prior to 1.12, which means you are encouraged to use an API version of 1.24 or higher.

I believe that 1.24 meets our requirements so it's tempting to go with that.

@wilkinsona wilkinsona changed the title Lower the minimum version of Docker required for building images Lower the minimum version of Docker required for building images to v1.24 Jan 30, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.3.0.M2 Jan 30, 2020
@hantsy

This comment has been minimized.

@scottfrederick

This comment has been minimized.

@lixinchuang
Copy link

this issue is really not fixed!
i encountered the same problem when using springboot 2.3.0 GA
I checked the docker API version
Api-Version: 1.39

@lixinchuang
Copy link

lixinchuang commented May 20, 2020

so you could not hard code the API_VERSION = 1.24 , it doesn't work

@wilkinsona
Copy link
Member

you could not hard code the API_VERSION

We believe that this is what we should do. Docker's documentation on versioning says the following:

If you omit the version-prefix, the current version of the API (v1.40) is used. For example, calling /info is the same as calling /v1.40/info. Using the API without a version-prefix is deprecated and will be removed in a future release.

So, to avoid using deprecated functionality, we are using a versioned URI. An API version of 1.39 suggests you are running Docker 18.09. It supports API version 1.12 and newer so using 1.24 should not be a problem.

It's unclear from what you've provided thus far what is causing your problem, but I do not believe it is our usage of the 1.24 API. If you would like us to spend some more time investigating please open a new issue and take the time to describe your problem in detail and the steps that we can follow to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

6 participants