Skip to content

Commit

Permalink
Verify-dockerfile Ignore scratch images
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Brown <[email protected]>
  • Loading branch information
rjbrown57 committed Jul 30, 2021
1 parent 0fdfaa9 commit 41005f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/cosign/cli/verify_dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ func getImagesFromDockerfile(dockerfile io.Reader) ([]string, error) {
for fileScanner.Scan() {
line := strings.TrimSpace(fileScanner.Text())
if strings.HasPrefix(line, "FROM") {
images = append(images, getImageFromLine(line))
switch image := getImageFromLine(line); image {
case "scratch":
fmt.Fprintln(os.Stderr, "- scratch image ignored")
default:
images = append(images,image)
}
}
}
if err := fileScanner.Err(); err != nil {
Expand Down

0 comments on commit 41005f5

Please sign in to comment.