Skip to content

A CI/CD pipeline with Docker

Select an icon to see what it is.

Step 3 of 6

Scan, and fail on serious findings

A scanner such as Trivy reads the built image and lists known vulnerabilities, as in the scanning lesson. The pipeline can be told to fail when it finds serious ones. A failed scan stops the pipeline before anything is pushed.

$ trivy image --exit-code 1 --severity HIGH,CRITICAL registry.example.com/shop/web:3f9a1c2

Result

no HIGH or CRITICAL findings: exit code 0, the pipeline continues
any finding: exit code 1, the pipeline stops here