I have in my code the next:
try (DockerClient client = DefaultDockerClient.fromEnv().connectTimeoutMillis(TimeUnit.SECONDS.toMillis(3)).build()) {
//some code here
}catch (DockerCertificateException e) {
log.warn("Failed to connect Docker Client {}", e.getMessage());
}
finally {
}
I need to close the client in the final block, but I can't because I'm getting an error (Cannot resolve symbol client).
Is there any way to close this client in the final block?