Skip to content

Commit

Permalink
fix: Added filtering history entries with no "created_by"
Browse files Browse the repository at this point in the history
For docker archives we extract auto detected user instructions from the image config. Some of the entries are missing "created_by" so we were throwing an error.
  • Loading branch information
agatakrajewska committed Feb 17, 2021
1 parent 8489b3d commit 503d5c9
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 503d5c9

Please sign in to comment.