@Override
  public DockerInfoDetails info() throws IOException, InterruptedException {
    // Runs 'docker info'.
    ExecutorService executor = Executors.newSingleThreadExecutor();
    Future<DockerInfoDetails> readerFuture = executor.submit(this::fetchInfoDetails);
    try {
      DockerInfoDetails details = readerFuture.get(DOCKER_OUTPUT_TIMEOUT, TimeUnit.MILLISECONDS);
      return details;
    } catch (TimeoutException e) {
      readerFuture.cancel(true); // Interrupt the reader thread
      throw new IOException("Timeout reached while waiting for 'docker info' output");
    } catch (ExecutionException e) {
      throw new IOException("Failed to read output of 'docker info': " + e.getMessage());
    } finally {
      executor.shutdownNow();
    }
  }
Instantiates with a {@code docker} executable and environment variables.

@param dockerExecutable path to {@code docker}
@param dockerEnvironment environment variables for {@code docker}
jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java