In the previous phase, we successfully set up Continuous Integration (CI) using Jenkins to automate the build and testing stages of our application. Now, we take the pipeline forward — by incorporating Docker to containerize our application artifacts, pushing the images to Amazon ECR, and finally implementing Continuous Deployment (CD) by hosting those images via AWS ECS.

This write-up builds directly on the earlier Jenkins CI pipeline and details how that workflow was extended into a full CI/CD pipeline with Docker and AWS.

image.png


CI with Docker: Creating and Publishing Container Images

We began by integrating Docker into the CI workflow to containerize the application. This allowed the application, along with its environment and dependencies, to be packaged into a portable and consistent format.

Objective:

Other registries like Docker Hub, Google Container Registry, or Azure Container Registry could have been used, but AWS ECR was chosen for its seamless integration with other AWS services.

Pipeline Steps:

  1. AWS Setup:
  2. Jenkins Configuration:
  3. Local Testing and AWS CLI Setup:

Result:

The Jenkins job successfully: