static String pullAndRunBuiltImage(String imageReference, String... extraRunArguments)
      throws IOException, InterruptedException {
    new Command("docker", "pull", imageReference).run();
    String history = new Command("docker", "history", imageReference).run();
    MatcherAssert.assertThat(history, CoreMatchers.containsString("jib-gradle-plugin"));

    List<String> command = new ArrayList<>(Arrays.asList("docker", "run", "--rm"));
    command.addAll(Arrays.asList(extraRunArguments));
    command.add(imageReference);
    return new Command(command).run();
  }
Pulls a built image and attempts to run it. Also verifies the container configuration and
history of the built image.

@param imageReference the image reference of the built image
@param extraRunArguments extra arguments passed to {@code docker run}
@return the container output
@throws IOException if an I/O exception occurs
@throws InterruptedException if the process was interrupted
jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/JibRunHelper.java