Path getTemporaryLayerFile(Path layerDirectory) {
    Path temporaryLayerFile = layerDirectory.resolve(TEMPORARY_LAYER_FILE_NAME);
    temporaryLayerFile.toFile().deleteOnExit();
    return temporaryLayerFile;
  }
Resolves a file to use as a temporary file to write layer contents to.

@param layerDirectory the directory in which to resolve the temporary layer file
@return the temporary layer file
jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageFiles.java