Skip to content

Commit

Permalink
Merge pull request #323 from snyk/fix/docker-empty-history-entries
Browse files Browse the repository at this point in the history
fix: Added filtering history entries with no "created_by"
  • Loading branch information
agatakrajewska committed Feb 17, 2021
2 parents 8489b3d + 503d5c9 commit 231f1ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/extractor/docker-archive/index.ts
Expand Up @@ -41,7 +41,7 @@ export function getPlatformFromConfig(

export function getDetectedLayersInfoFromConfig(imageConfig) {
const runInstructions = getUserInstructionLayersFromConfig(imageConfig)
.filter((instruction) => !instruction.empty_layer)
.filter((instruction) => !instruction.empty_layer && instruction.created_by)
.map((instruction) => instruction.created_by.replace("# buildkit", ""));

const dockerfilePackages = getPackagesFromRunInstructions(runInstructions);
Expand Down

0 comments on commit 231f1ec

Please sign in to comment.