@BeforeClass
  public static void createImage()
      throws InvalidImageReferenceException, InterruptedException, CacheDirectoryCreationException,
          IOException, RegistryException, ExecutionException {

    Path root = imageLocation.getRoot().toPath();
    Path fileA = Files.createFile(root.resolve("fileA.txt"));
    Path fileB = Files.createFile(root.resolve("fileB.txt"));
    Path fileC = Files.createFile(root.resolve("fileC.txt"));
    Path subdir = Files.createDirectory(root.resolve("dir"));
    Path subsubdir = Files.createDirectory(subdir.resolve("subdir"));
    Files.createFile(subdir.resolve("fileD.txt"));
    Files.createFile(subsubdir.resolve("fileE.txt"));

    imageTar = new File(imageLocation.getRoot(), "image.tar");
    Containerizer containerizer =
        Containerizer.to(TarImage.at(imageTar.toPath()).named("jib-core/reproducible"));

    Jib.fromScratch()
        .setEntrypoint("echo", "Hello World")
        .addLayer(ImmutableList.of(fileA), AbsoluteUnixPath.get("/app"))
        // layer with out-of-order files
        .addLayer(ImmutableList.of(fileC, fileB), "/app")
        .addFileEntriesLayer(
            FileEntriesLayer.builder()
                .addEntryRecursive(subdir, AbsoluteUnixPath.get("/app"))
                .build())
        .containerize(containerizer);
  }
Verify that created image has explicit directory structures, default timestamps, permissions, and
file orderings.
jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/ReproducibleImageTest.java