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.
More on Build Performance & CI
How do you make Docker builds fast in CI where runners are ephemeral?BeginnerWhat are the cache backends in buildx?BeginnerWhy does `inline` cache often disappoint?AdvancedHow do you structure a Python Dockerfile for the best caching and size?IntermediateHow do you structure a Node.js production image?IntermediateHow do you build a small Java image?Beginner