Browse Source

Added some additional logging and exposed parsed components

master
Drew Short 3 years ago
parent
commit
2ac731db0b
  1. 12
      internal/parser/dockerfile/dockerfile.go

12
internal/parser/dockerfile/dockerfile.go

@ -141,10 +141,14 @@ func parseRepositoriesFromDockerfileStage(dockerfileStage buildkitDockerfileInst
log.Tracef("Parsing RunCommand \"%s\" for repositories", runCommand.CmdLine)
_, err := typedCommandParser.GetRepositories(runCommand.CmdLine[0])
parsedRepositories, err := typedCommandParser.GetRepositories(runCommand.CmdLine[0])
if err != nil {
log.Fatalf("Unexpected error while parsing repositories: %s", err)
return nil, err
}
for _, parsedRepository := range parsedRepositories {
repositories = append(repositories, parsedRepository)
}
}
}
@ -162,10 +166,14 @@ func parsePackagesFromDockerfileStage(dockerfileStage buildkitDockerfileInstruct
log.Tracef("Parsing RunCommand \"%s\" for packages", runCommand.CmdLine)
_, err := typedCommandParser.GetPinnedPackages(runCommand.CmdLine[0])
parsedPinnedPackages, err := typedCommandParser.GetPinnedPackages(runCommand.CmdLine[0])
if err != nil {
log.Fatalf("Unexpected error while parsing pinned packages: %s", err)
return nil, err
}
for _, parsedPinnedPackage := range parsedPinnedPackages {
packages = append(packages, parsedPinnedPackage)
}
}
}

Loading…
Cancel
Save