Build and Deployment: Before and After Docker
Before Docker
Build. A developer pushes a change to source control. CI detects the new code, rebuilds the project, runs the tests, and produces an application package such as a JAR, WAR, or EAR. CI stores that package as a build artifact in a repository.
Deployment. Dependencies and configuration are set up on the target application servers, physical or virtual. The package is downloaded. The application is started.
The problems. Packaging and deploying across multiple environments is genuinely difficult. Every environment must be prepared before deployment. And applications that work in one environment may fail in another because of differing operating systems, dependencies, libraries, or software versions.
After Docker
Build. A developer pushes a change. CI rebuilds, tests, and produces the application package — then also builds a Docker image containing the application code, its dependencies, and its configuration. CI pushes that image to a registry, whether public (Docker Hub) or private (Nexus, JFrog, ECR).
Deployment. Pull the image. Start it, which creates the container in which the application runs.
The gain. The identical artifact runs in development, test, and production. Environment preparation collapses into the image build, which happens once.