private static String buildToDockerDaemonAndRun(TestProject project, String imageReference)
      throws VerificationException, IOException, InterruptedException, DigestException {
    buildToDockerDaemon(project, imageReference, "pom.xml");

    String dockerInspectVolumes =
        new Command("docker", "inspect", "-f", "'{{json .Config.Volumes}}'", imageReference).run();
    String dockerInspectExposedPorts =
        new Command("docker", "inspect", "-f", "'{{json .Config.ExposedPorts}}'", imageReference)
            .run();
    String dockerInspectLabels =
        new Command("docker", "inspect", "-f", "'{{json .Config.Labels}}'", imageReference).run();
    String history = new Command("docker", "history", imageReference).run();

    MatcherAssert.assertThat(
        dockerInspectVolumes, CoreMatchers.containsString("\"/var/log\":{},\"/var/log2\":{}"));
    MatcherAssert.assertThat(
        dockerInspectExposedPorts,
        CoreMatchers.containsString(
            "\"1000/tcp\":{},\"2000/udp\":{},\"2001/udp\":{},\"2002/udp\":{},\"2003/udp\":{}"));
    MatcherAssert.assertThat(
        dockerInspectLabels,
        CoreMatchers.containsString("\"key1\":\"value1\",\"key2\":\"value2\""));

    return new Command("docker", "run", "--rm", imageReference).run();
  }
Builds and runs jib:buildDocker on a project at {@code projectRoot} pushing to {@code
imageReference}.
jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildDockerMojoIntegrationTest.java