Docker: move the same image from testing to production

Containers help standardize an environment, but do not replace configuration or backups. Build a repeatable deployment process.

We tested something similar to production

Imagine rebuilding an application on the server after tests finish. A dependency has changed in the meantime. The deployed program resembles the tested version but is not the same artifact. Explaining the new behavior is now harder.

Docker describes containers as isolated processes running with their environment. Its container introduction explains component isolation. Reproducibility also requires control over the exact image being launched.

Build once and promote the result

In an example pipeline, the team builds an image, records its identity, runs tests and deploys that same image. A mutable tag alone is insufficient evidence of the version. Connect the source revision, image and running service.

Pass environment configuration and secrets separately using the infrastructure's mechanism. Keep production passwords out of images and build logs. Also decide where data lives when it must survive container replacement.

Replacing a process is only part of deployment

Check handling of in-flight requests, shutdown signals and startup. Database migrations need a separate compatibility plan. Rolling back an image does not automatically undo data changes.

Launch the environment from scratch, verify an essential workflow and rehearse returning to the previous version. A useful container process makes it possible to explain what is running and reproduce it. A Dockerfile alone does not provide that confidence.