@@ -24,7 +24,6 @@ import (
2424 "github.com/docker/cli/internal/jsonstream"
2525 "github.com/docker/cli/internal/lazyregexp"
2626 "github.com/docker/cli/opts"
27- "github.com/docker/docker/api"
2827 buildtypes "github.com/docker/docker/api/types/build"
2928 "github.com/docker/docker/api/types/container"
3029 registrytypes "github.com/docker/docker/api/types/registry"
@@ -437,6 +436,10 @@ type resolvedTag struct {
437436 tagRef reference.NamedTagged
438437}
439438
439+ // noBaseImageSpecifier is the symbol used by the FROM
440+ // command to specify that no base image is to be used.
441+ const noBaseImageSpecifier = "scratch"
442+
440443// rewriteDockerfileFromForContentTrust rewrites the given Dockerfile by resolving images in
441444// "FROM <image>" instructions to a digest reference. `translator` is a
442445// function that takes a repository name and tag reference and returns a
@@ -451,7 +454,7 @@ func rewriteDockerfileFromForContentTrust(ctx context.Context, dockerfile io.Rea
451454 line := scanner .Text ()
452455
453456 matches := dockerfileFromLinePattern .FindStringSubmatch (line )
454- if matches != nil && matches [1 ] != api . NoBaseImageSpecifier {
457+ if matches != nil && matches [1 ] != noBaseImageSpecifier {
455458 // Replace the line with a resolved "FROM repo@digest"
456459 var ref reference.Named
457460 ref , err = reference .ParseNormalizedNamed (matches [1 ])
0 commit comments