@Override
  public DockerImageDetails inspect(ImageReference imageReference)
      throws IOException, InterruptedException {
    Process inspectProcess =
        docker("inspect", "-f", "{{json .}}", "--type", "image", imageReference.toString());

    try (InputStreamReader stdout =
        new InputStreamReader(inspectProcess.getInputStream(), StandardCharsets.UTF_8)) {
      String output = CharStreams.toString(stdout);

      if (inspectProcess.waitFor() != 0) {
        throw new IOException(
            "'docker inspect' command failed with error: " + getStderrOutput(inspectProcess));
      }

      return JsonTemplateMapper.readJson(output, DockerImageDetails.class);
    }
  }
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