9.2 CI/CD, Containers, And Deployment Basics
CI/CD turns build, test, package, release, and verification into a repeatable pipeline. Containers package the application and runtime dependencies into a more consistent artifact, reducing "works on my machine" environment drift.
But containers and pipelines do not automatically make software correct. They make feedback and release more controllable.
CI: Continuous Integration
Continuous integration helps teams merge small changes frequently and find integration problems quickly. A basic CI flow may include:
- Formatting and linting.
- Unit tests.
- Type checks.
- Integration or contract tests.
- Artifact build.
- Security scan.
CI failure is not an annoyance. It is bad news arriving early. The earlier it arrives, the cheaper it is to fix.
CD: Continuous Delivery And Deployment
Continuous delivery means the system stays in a releasable state, while a human may still decide when to release. Continuous deployment means validated changes automatically reach production.
Either way, safe release mechanisms matter:
- Small batches.
- Canary or phased rollout.
- Health checks.
- Monitoring and alerts.
- Fast rollback.
- Artifact traceability.
Docker And Kubernetes Mental Model
Docker is commonly used to build images and run containers. An image is a packaged runtime environment; a container is a running instance of that image.
Kubernetes orchestrates containers: replicas, rolling updates, service discovery, health probes, config and secrets, automatic recovery, and more. It solves deployment and runtime organization problems, not business correctness.
When learning containers, keep image, configuration, data, network, and permission as separate dimensions. Mixing them together makes deployment fragile.