private static String getStderrOutput(Process process) {
    try (InputStreamReader stderr =
        new InputStreamReader(process.getErrorStream(), StandardCharsets.UTF_8)) {
      return CharStreams.toString(stderr);
    } catch (IOException ex) {
      return "unknown (failed to read error message from stderr due to " + ex.getMessage() + ")";
    }
  }
Gets a function that takes a {@code docker} subcommand and gives back a {@link ProcessBuilder}
for that {@code docker} command.

@param dockerExecutable path to {@code docker}
@return the default {@link ProcessBuilder} factory for running a {@code docker} subcommand
jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java