diff --git a/internal/parser/dockerfile/dockerfile.go b/internal/parser/dockerfile/dockerfile.go index 455aece..524a3ea 100644 --- a/internal/parser/dockerfile/dockerfile.go +++ b/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) + } } }