Interview Prep/Docker/Build Performance & CI

How do you test an image in CI before pushing it?

BeginnerProductionBuild Performance & CI
Answer

Build with --load, run a smoke test (start, wait for healthcheck, curl /health), run container-structure-test for file/metadata assertions, scan with Trivy, then push. In Compose-based tests use up --wait and --exit-code-from. Promote the same digest to prod rather than rebuilding.

All Docker questions Roadmap: Docker & containers

More on Build Performance & CI