How to manage docker app in AWS

Anuj Shashimal
3 min readDec 28, 2020

--

Before dive into the dockized app run in the AWS, we need to know how the AWS instances are working once you deployed. Think about the microservice architecture. In each of the services are running inside the containers. Containers are scale up very quickly. You may have used third party libraries. Such as authentication or messaging you handling through the microservices. Assume that you have develop 10 services. Those services are running inside the ec2 instances of AWS. Each of the instances you installed docker on it. After the process is done how you mange those services. How you can know about what are running containers or want are crashed or not need containers. You have to configure in manually. You have to automate full process. That how the containers orchestration tools are came in to the picture. The best container orchestration tools which AWS used is ECS (Elastic Container Service). This service is same as the Kubernetes. In the previous blog I describe about how the Fargate is work. This is the simple description about how the fargate is working. When you created the ECS cluster with some services. That scenario ECS cluster is working as controller. It scheduling and orchestration the containers which are connect with ECS cluster. For that containers need some virtual environment to run. That is provided by EC2 instances. That scenario you also need to manage the virtual instances which are running containers on it. For that scenario fargate is came to the picture. You only have to provide the services. Fargate will manage all the services. We are not going to create or manage any instances. All are managed by fargate. That cool right. That’s the simple description about dockized app managed by AWS. Let’s have to go with how can you develop with ECR, ECS, VPC and Fargate.

First of all, you need to configure docker image locally. Once you did it, you need to push that image to remote repository. Which are AWS ECR (Elastic container registry). For achieve that you need to install docker and AWS CLI in your local machine. Once you push image into the AWS ECR, you need to configure the network properly. For do it you have to knowledge about AWS VPS. Using AWS VPC all the containers are manage in the private network and load balances must running in the public network. You have to create one VPC with an IP. Once you created VPC. You need to divided into private subnet and public subnet. Private subnet is to run docker containers. Public subnet is to run load balances which are open to anyone from the internet to access. Remember that in the private subnet which are created you need to configure API gateway to access it. That is accessible withing the Virtual Private Network. NAT Gateway also you need to provide with the internet accessibility. Otherwise, instances type is not coming to the running state. Because in the docker image you need to install all the dependencies in that container. Which need to achieve this need to internet access withing the container. It is the reason of configure the NAT gateway inside the service. After the network process is done need to create the ECS Cluster that is run to the containers. Once you created the cluster then you need to define the task definitions. In that definition you define all the instances type. Memory size, cpu size. After the task definition id done. In that task definition you need to mention docker image which are pushed to the ECR.

That is the simple description about what what going to develop in next blog. I will do practical way in the next blog. Thank you!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response