Skip to content

Commit

Permalink
Fix failures related to symlinked layer files
Browse files Browse the repository at this point in the history
  • Loading branch information
gschneider-r7 committed Jun 16, 2020
1 parent f5dd81b commit 14ce15c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ public void untar(File tar, File destination) throws FileNotFoundException, IOEx
}

private void processLayer(Image image, Configuration configuration, Layer layer, File tar) throws FileNotFoundException, IOException {
// skip invalid files (too small to be a tar or gzipped tar, and symlinks are duplicate layers)
if (tar.length() < 100)
return;

try (TarArchiveInputStream tarIn = new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(tar), 65536))) {
processLayerTar(image, configuration, layer, tar, tarIn);
Expand Down

0 comments on commit 14ce15c

Please sign in to comment.