The need: link source code to an identifiable image

An application should be deliverable without depending on a developer’s workstation or a sequence of undocumented commands. The pipeline connects a source revision to its tests, a defined build environment and an identifiable image. Dependencies are locked and environment-specific settings are kept separate from code to limit differences between validation and production.

Build once, promote the same image

The pipeline runs code checks, builds a container image and verifies its behaviour before publishing it to a registry. Each release receives a versioned reference linked to the source code and pipeline. The same image is then used across environments without an intermediate rebuild. Its digest identifies the exact content to deploy, independently of any moving alias such as latest.

Reduce size without losing required dependencies

A multi-stage build separates compilation tools from the delivered runtime. The final image retains the libraries, certificates and native dependencies required on the target platform. Size reduction is accompanied by tests run inside that image: startup, component loading and representative application operations. Size is not the only criterion; maintainability and correct runtime behaviour remain priorities.

Distinguish technical checks from the complete service

Unit tests, integration tests and startup checks answer different questions. Validation also covers interactions with external dependencies in a suitable environment. Secrets are injected at deployment and pipeline access is limited to the required scope. After release, health checks and a functional user journey verify that the application delivers the expected service; a running process alone does not demonstrate this.

Deploy explicitly and prepare rollback

Deployment selects a validated image and follows a repeatable procedure, triggered manually or automatically according to operational constraints. Previous versions are retained and rollback criteria are defined before cutover. Reverting to an earlier image requires checking compatibility with the configuration and data schema. Database migrations and writes made after release need their own strategy: restoring code does not restore data.

Key considerations

  • Traceability from code to release
  • Automated tests and builds
  • Versioned images and controlled promotion
  • Runtime and service validation
  • Documented deployment and rollback
Discuss your architecture ↗