Scan suggest message in docker compose build

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2021-02-24 15:23:56 +01:00
parent f212d61058
commit 156efb8463
2 changed files with 9 additions and 1 deletions

View File

@ -127,6 +127,14 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
if err == nil {
err = errW
}
if err == nil {
commands := make([]string, 0, len(opts))
for image, _ := range opts {
commands = append(commands, fmt.Sprintf("docker scan %s", image))
}
allCommands := strings.Join(commands, ", ")
fmt.Printf("Try scanning the image you have just built to identify vulnerabilities with Dockers new security tool: %s\n", allCommands)
}
return err
}

View File

@ -6,4 +6,4 @@ services:
nginx2:
build: nginx-build
image: custom-nginx
image: gtardif/custom-nginx