ignore scratch frm dockerfile imports

This commit is contained in:
laurentsimon 2021-05-20 16:59:26 +00:00 committed by Naveen
parent 9453765aa0
commit 78933ac2f4
3 changed files with 6 additions and 0 deletions

View File

@ -90,6 +90,9 @@ func validateDockerfile(path string, content []byte,
}
switch {
// scratch is no-op.
case len(valueList) > 0 && strings.EqualFold(valueList[0], "scratch"):
continue
// FROM name AS newname.
case len(valueList) == 3 && strings.EqualFold(valueList[1], "as"):
name := valueList[0]

View File

@ -24,4 +24,5 @@ RUN apt-get update;\
apt-get install -y vim;\
true
FROM scratch
FROM python@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2

View File

@ -23,4 +23,6 @@ RUN CGO_ENABLED=0 make build-scorecard
from build as build2
RUN /hello-world
FROM scratch as build3
FROM python@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 as build3