GoogleContainerTools/jib · error · IOException

Failed to read output of 'docker info': <message>

Error message

Failed to read output of 'docker info': <message>

What it means

CliDockerClient.info() submits fetchInfoDetails() to an executor; if that task itself throws (any Exception wrapped in ExecutionException), the error is rethrown as IOException 'Failed to read output of 'docker info': <message>'. This means reading or parsing the 'docker info' output failed, not that it timed out.

Source

Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java:212

  @Override
  public boolean supported(Map<String, String> parameters) {
    return true;
  }

  @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();
    }
  }

  @Override
  public String load(ImageTarball imageTarball, Consumer<Long> writtenByteCountListener)
      throws InterruptedException, IOException {
    // Runs 'docker load'.
    Process dockerProcess = docker("load");

    try (NotifyingOutputStream stdin =
        new NotifyingOutputStream(dockerProcess.getOutputStream(), writtenByteCountListener)) {
      imageTarball.writeTo(stdin);

    } catch (IOException ex) {
      // Tries to read from stderr. Not using getStderrOutput(), as we want to show the error
      // message from the tarball I/O write failure when reading from stderr fails.

View on GitHub (pinned to fb949e2676)

Solutions

  1. Look at the embedded <message> (and its cause) to see the underlying failure
  2. Run 'docker info' manually; fix any daemon/CLI error it reports
  3. Verify 'docker info' emits valid JSON (docker info --format '{{json .}}'); upgrade Docker if the CLI is very old
  4. If the daemon is down, start Docker Desktop / the docker service before running the build

Example fix

// before
DockerInfoDetails details = dockerClient.info(); // IOException: Failed to read output...
// after
try {
  DockerInfoDetails details = dockerClient.info();
} catch (IOException e) {
  logger.warn("docker info failed: {} — check the daemon is running", e.getMessage());
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Run 'docker info' yourself first and check it succeeds and prints JSON
Process p = new ProcessBuilder("docker", "info").start();
if (p.waitFor() != 0) throw new IllegalStateException("docker daemon unavailable");

Try / catch

try {
  details = dockerClient.info();
} catch (IOException e) {
  // message: Failed to read output of 'docker info': <cause>
  logger.error("docker info failed: {}", e.getMessage(), e.getCause());
  throw new UnhealthyDockerException(e);
}

Prevention

When it happens

Trigger: fetchInfoDetails() throws internally — e.g. the 'docker info' process exits nonzero (see the 'docker info' command failed error), reading stdout fails with an IOException, or JSON parsing of the output fails.

Common situations: Broken/partial Docker installation, docker CLI printing non-JSON error text, daemon down so 'docker info' exits with an error, or I/O errors on the pipe between Jib and the docker process.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/ed6bcec5e9f75473. Report an issue: GitHub.