Closed as not planned
Description
I got a problem when trying to use the gradle buildBootImage
task. I managed to track the source of the problem and it was a problem with my installation of docker which refused to allow a _ping
.
But the symptom was not really clear as I only got the following message : Docker API version must be at least 1.41 to support the 'imagePlatform' option, but current API version is 1.24
I think this could be a good idea to add a log message when you get an exception when trying to ping the docker installation.
But after looking at DockerAPI and SystemAPI classes, I don't really know which form it could take :
class SystemApi {
SystemApi() {
}
/**
* Get the API version supported by the Docker daemon.
* @return the Docker daemon API version
*/
ApiVersion getApiVersion() {
try {
URI uri = new URIBuilder("/_ping").build();
try (Response response = http().head(uri)) {
Header apiVersionHeader = response.getHeader(API_VERSION_HEADER_NAME);
if (apiVersionHeader != null) {
return ApiVersion.parse(apiVersionHeader.getValue());
}
}
catch (Exception ex) {
// fall through to return default value
// Add a way to log the exception here ?
}
return MINIMUM_API_VERSION;
}
catch (URISyntaxException ex) {
throw new IllegalStateException(ex);
}
}
}