Microservices Using Java, Docker & Cloud Containers

This post describes some of the common considerations for developing microservices in Java and deploying the microservice on cloud containers offered by Google cloud (GCP), Amazon Web Services (AWS) and IBM cloud.

3. Deploy java microservice Docker image to cloud container

High level flow above shows deployment of the microservice to container using CI/CD pipeline.

A typical CI/CD workflow follows these steps:

Build Application — A change to the version control (ex. GitHub) of the application triggers a build. Resulting built jars/wars stored in the artifacts repository.

Build Image — The CI Agent pulls the Dockerfile and associated files to build the image from version control. The Dockerfile is setup so that the artifact built-in the previous step is copied into the image.

Deploy Image to Test environment — deploy the image for testing.

Test Application — The CI Agent deploys a test container to test the application deployed in the previous step. If all of the tests pass, then the image can be signed with a QA