Tuesday, June 23, 2020

AWS Hands-On: Break a Monolith Application into Microservices (Module 1)

Module 1: Containerize the Monolith
In a real world application, the assumption is that we've already containerized our 'monolith' application and that a corresponding Dockerfile has already been created for it. Module 1 is a demonstration on how we can store a Docker image of that monolith application in Amazon EC2 Container Repository (ECR). This is just a summary of what goes, the steps and definitions are well documented in the AWS hands-on project link above.

Prerequisites:
1. AWS account, Git client, a text editor. These are pretty straightforward already.
2. Docker. I am currently at Fedora 32 but there is no Docker-ce official release yet for this version as of writing so I used this guide instead. Extra steps: I added my user to the 'docker' group so that I don't need to do 'sudo' for every docker command that I run.
After installing Docker, I proceeded with installing AWS CLI. I chose to install version 2 as recommended.
There will be a Git project that needs to be downloaded/cloned. It will contain infrastructure scripts and the Dockerfile of the test monolith application.
Next is the provisioning of a container repository in ECR. The resulting docker image of the monolith app will be stored here later.
Finally, the building and pushing of the Dockerized monolith app. 
Initially, I encountered an error while attempting to authenticate Docker to ECR so I proceeded on building and tagging the image first.
For the ECR docker login part, there is a new process described here. After successfully hooking up my Docker and ECR, I was then able to push the image.

0 comments:

Post a Comment