Skip to content

Commit 7c0d083

Browse files
Improved Dockerfile parser for same images with different alias #1777 (#1778)
1 parent d7a2e97 commit 7c0d083

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/parser/docker/parser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package docker
33
import (
44
"bytes"
55
"encoding/json"
6+
"strings"
67

78
"github.com/Checkmarx/kics/pkg/model"
89
"github.com/moby/buildkit/frontend/dockerfile/parser"
@@ -45,7 +46,7 @@ func (p *Parser) Parse(_ string, fileContent []byte) ([]model.Document, error) {
4546

4647
for _, child := range parsed.AST.Children {
4748
if child.Value == "from" {
48-
fromValue = child.Next.Value
49+
fromValue = strings.TrimPrefix(child.Original, "FROM ")
4950
}
5051

5152
cmd := Command{

0 commit comments

Comments
 (0)