Designing a CI/CD pipeline developers will not route around
A pipeline succeeds when it is fast enough to trust and strict enough to matter. Getting that balance wrong is why teams disable checks.
Most container vulnerabilities come from what you did not need to include. Reducing the image is the most effective single control.
A full operating system image carries hundreds of packages your application never uses, each a potential vulnerability that will appear in scan reports and need triaging.
Distroless or minimal base images remove the shell and package manager entirely. This eliminates most reported vulnerabilities and makes an attacker's job considerably harder if they do get execution.
Use a multi-stage build so compilers, development dependencies and build tooling stay in the build stage and never reach the final image.
The runtime image should contain the application, its runtime dependencies and nothing else. This routinely reduces image size by an order of magnitude, which also speeds deployment.
That last point matters more each year. When a widely used library has a serious disclosure, the organisations that answer within hours are the ones that already know what they ship.
Run as a non-root user, mount the filesystem read-only where possible, drop unnecessary capabilities and set resource limits.
These are configuration changes rather than engineering work, and together they meaningfully limit what a compromised container can do.
Base images age. A container built six months ago carries whatever vulnerabilities existed then, and it will keep carrying them until it is rebuilt, regardless of whether your application code changed.
Schedule periodic rebuilds of images that are still deployed, so patched base layers reach production without waiting for a feature release. This is straightforward to automate and is skipped surprisingly often.
Standardise on a small set of approved base images maintained centrally. An organisation with twenty different base images has twenty upgrade paths; one with three has three.
As small as the application genuinely needs. Compiled languages can reach a few megabytes; interpreted runtimes are larger. The goal is removing what is unnecessary rather than hitting a number.
Assess whether the vulnerable path is reachable in your usage, document the decision, and set a review date. Suppressing without assessment is how genuine issues get missed.
For anything proprietary, yes. It also gives you control over retention, scanning and access, which public registries do not.
Keep reading
A pipeline succeeds when it is fast enough to trust and strict enough to matter. Getting that balance wrong is why teams disable checks.
Four measures describe delivery performance well. They are useful for finding constraints and harmful when used to compare teams.
Credentials in repositories remain one of the most common causes of breach, and it is one of the most preventable.