public static CacheDirectories from(CommonCliOptions commonCliOptions, Path contextRoot) {
    Preconditions.checkArgument(
        Files.isDirectory(contextRoot),
        "contextRoot must be a directory, but " + contextRoot.toString() + " is not.");
    return new CacheDirectories(
        commonCliOptions.getBaseImageCache().orElse(null),
        commonCliOptions
            .getProjectCache()
            .orElse(
                Paths.get(System.getProperty("java.io.tmpdir"))
                    .resolve("jib-cli-cache")
                    .resolve("projects")
                    .resolve(getProjectCacheDirectoryFromProject(contextRoot))));
  }
Create a caches helper for cli cache locations.

@param commonCliOptions cli options for user configured cache directories
@param contextRoot the context root, use the parent directory of single files, this context
    root must exist
@return an instance of CacheDirectories with cli specific cache locations
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/CacheDirectories.java