AWS Fargate Container setup
- Setup Fargate using ECR and ECS and run Docker Container on Fargate
- We create a Docker Image of our app By dockerizing it and then we save the image in a repository.
- Examples of repositories are
- Docker hub
- Elastic container registry (ECR)
- A repository has Following features
- Fully managed
- Highly available
- Secure
- Simplified workflow
- To run a docker Image in ECR we use ECS(Elastic Container Service) cluster to host the image and then run EC2’s and deploy container in one of the EC2’s.
- We have to take care of
- Deploying
- Scheduling
- Scaling
- Management
- Another option to run Docker image is in AWS Fargate containers.
- Advantages of running docker image in AWS Fargate are.
- No clusters to manage.
- No EC2 vo provision, scale or manage.
- Seamless scaling
- Pay for what you use. using
- Integrated with AWS ecosystem
- Highly Available
- Steps to add image to Fargate
- Launch an EC2 instance
- Install docker
- Create Docker image from Docker
- Push the image to ECR
- Login to ECR from EC2 and push the image.
- Goto Fargate It will go to ECS because Fargate runs in ECS cluster.
- Create a Fargate cluster
- Check EC2 section You will find no EC2 instances running.
- Next we need to define tasks
- Containers run within a task.
- Task CPU and memory is shared by the containers running inside.
- Containers Specific CPU and memory can be allocated.
- Create a new task and add container to it.
- Access container using public IP.
- Check here how to run a Spring Boot Image in fargate
fs
Comments
Post a Comment