Why scan the image before pushing it?
AdvancedConceptIntegrations: SonarQube, Nexus, Artifactory, Docker, Trivy
Answer
If you push first and scan afterwards, a vulnerable image already exists in the registry with a valid tag, and anything watching the tag (Argo CD image updater, a developer running pull) may deploy it. Building to a local tarball (Kaniko --no-push --tar-path, docker save, BuildKit type=oci), scanning it, and only then pushing guarantees that every image in the registry passed the gate.
More on Integrations: SonarQube, Nexus, Artifactory, Docker, Trivy
How do you integrate SonarQube with a Jenkins pipeline?IntermediateHow does `waitForQualityGate` work?IntermediateHow do you deploy Maven artifacts to Nexus from Jenkins?IntermediateHow do you publish npm packages or pull dependencies through Nexus or Artifactory?BeginnerHow do you use JFrog Artifactory from Jenkins?IntermediateHow do you build and push a Docker image from Jenkins on a VM agent?Beginner