Microservice always promotes fast shipping and deployment for any new feature or code base. To make this happen, we have to configure our CI and CD environments according to that. Dockerizing our microservice also requires our CI and CD environments to accommodate fast shipping and deployment. In this section, we will try to demonstrate how to build a pipeline for a containerized microservice with the help of Jenkins, Maven, and Docker composers. We will build the Docker image of our microservice, push it to the repository, and then run the Docker container with image. Here is the cycle we will follow in this:
- The developer pushes code to GitHub and GitHub hook notifies the Jenkins job
- Jenkins pulls the repository code from GitHub, including the Docker file committed by the developer
- Jenkins compiles the source code, runs unit test cases, and then builds and packages with the help of
maven-docker
- Deploy the last successful build artifacts...