3 ways to run Docker on AWS

3 ways to run Docker on AWS

There are a bunch of different ways to run your containerized workloads on AWS. This blog post compares the three most important ways to run Docker on AWS: * **Amazon Elastic Container Service (ECS) with AWS Fargate** * **Amazon Elastic Container...

There are a bunch of different ways to run your containerized workloads on AWS. This blog post compares the three most important ways to run Docker on AWS:

  • Amazon Elastic Container Service (ECS) with AWS Fargate
  • Amazon Elastic Container Service for Kubernetes (EKS)
  • AWS Elastic Beanstalk (EB) with Single Container Docker

ECS with Fargate
First, let’s have a look at ECS, a fully-managed container orchestration service. ECS is a proprietary but free of charge solution offered by AWS. It is important to mention that ECS provides a high level of integration with the AWS infrastructure. For example, containers are 1st class citizens of the VPC with their network interface (ENI) and security groups.

If you are interested to learn AWS you can neroll for free live demo AWS Online course

ECS offers service discovery via a load balancer or DNS (Cloud Map).

Aside from that ECS is the only option to run Docker containers without running EC2 instances on AWS. Fargate is the compute engine for ECS. All the heavy lifting of scaling the number of EC2 instances and containers, rolling out updates to EC2 instances without affecting containers, and many more is gone.

ECS is free of charge. Fargate is billed per second based on CPU and memory allocated for your containers. A container with 1 vCPU and 4 GB is about USD 30 per month.

Keep in mind the following limitations of Fargate:

General purpose compute capacity only. Fargate does not support GPU, CPU/memory optimized configurations at the moment.
Persistent volumes are not supported out of the box (e.g., Docker volume driver).
No discounts for reserved capacity available.

EKS (Kubernetes)
The 2nd option to run Docker containers on AWS is Kubernetes (K8s). In summary, K8s is an open-source container orchestration solution. AWS offers the K8s master layer as a service. The master layer is responsible for storing the state of the container cluster and deciding on which machines new containers should be placed. On top of that, you are responsible for managing a fleet of EC2 instances used to run the containers.

The main selling point for K8s: it is open-source and runs on AWS, Azure, Google Cloud, on-premises, or even on your local machine. The resulting disadvantage is that Kubernetes is not that well integrated with the AWS infrastructure.

Kubernetes is designed for microservice architectures. For example, a built-in service discovery allows containers to talk to each other easily by using a local proxy.

EKS is about USD 144 per month for the master layer. Besides, you are paying for the EC2 instances powering your containers. A t3.medium instance provides 2 CPUs with 4 GiB of memory and costs around USD 30 USD per month.

You should not underestimate the complexity of operating EKS and EC2. For example, the way EKS integrates with the VPC comes with a few unexpected limitations (see EKS vs. ECS: orchestrating containers on AWS for more details).

Learn for more Latest AWS Interview questions

Elastic Beanstalk
Another option to run Docker containers on AWS is Elastic Beanstalk. Some say Elastic Beanstalk is the PaaS (Platform-as-a-Service) offering from AWS. Nevertheless, Elastic Beanstalk is very easy to use. There are a bunch of environments to deploy your web application with Elastic Beanstalk. One of them is called Single Container Docker. This environment deploys a single Docker container to one or multiple EC2 instances.

Elastic Beanstalk is not only deploying your application; it is also creating the needed infrastructure consisting of a database, a load balancer, and EC2 instances. Important to note: Elastic Beanstalk creates EC2 instances automatically. But you are still responsible for these virtual machines they are not fully-managed by AWS.

Elastic Beanstalk is a proprietary but free of charge solution offered by AWS. You are only paying for the underlying infrastructure. For example, a t3.medium instance provides 2 CPUs with 4 GiB of memory and costs around USD 30 USD per month.

Take your career to new heights of success with an AWS Online Training

My recommendation
My experience shows that managing the virtual machines for a dynamic container workload requires a lot of effort. The big difference between the three options discussed in this article is the service depth provided by AWS.

That is why I highly recommend using ECS and Fargate to run your Docker workloads on AWS. With Fargate you do not need to patch, scale, monitor virtual machines anymore. Imagine Fargate as a flexible and production-grade Platform-as-a-Service offering for Docker containers. No need to invest effort into your container platform any longer.

AWS Training Online Course - Best AWS Certification - Intellipaat

AWS Training Online Course - Best AWS Certification - Intellipaat

Enroll for best AWS training course with AWS Certification online and placement support. Learn Amazon web services AWS course from certified AWS experts. Enroll Now!

Enroll for best AWS training course with AWS Certification online and placement support. Learn Amazon web services AWS course from certified AWS experts. Enroll Now!

Redefine your career with the AWS Course.

Redefine your career with the AWS Course.

APTRON Gurgaon with its start-of-art class rooms and Lab infrastructure at Gurgaon offer the best and most conducive learning environment, with a team of highly skilled trainers having years of industry experience. [AWS Course in...

APTRON Gurgaon with its start-of-art class rooms and Lab infrastructure at Gurgaon offer the best and most conducive learning environment, with a team of highly skilled trainers having years of industry experience. AWS Course in Gurgaon Classroom trainings will be conducted consistently. Practical exercises are provided for the topics conducted on everyday schedule to be worked after during the lab session. Online session conducted through the virtual classroom likewise have the same program stream with theory and practical sessions. Our Labs can be accessed online from over the world enabling our online training student to make the best use of the infrastructure from the comfort of their home.
Distributed computing and AWS is one of the fastest developing technologies today in the IT market place. Skilled AWS resources are in great demand crosswise over industry verticals as cloud architects, cloud content administrators and storage managers, technical developer for development and deployment of applications on the AWS, network administrators on cloud.

AWS Tutorial | AWS Full Course - Learn AWS In 11 Hours | AWS Training | Intellipaat

AWS Tutorial | AWS Full Course - Learn AWS In 11 Hours | AWS Training | Intellipaat

➡ This AWS full course is an end to end aws tutorial where you will learn aws from scratch & master all the advanced concepts quite easily. 🔥Intellipaat AWS ...

This AWS full course is an end to end aws tutorial where you will learn aws from scratch & master all the advanced concepts quite easily.

Why should you opt for an AWS career?

If you want to fast-track your career then you should strongly consider AWS. Today cloud computing is no longer optional but critical to the success of some of the biggest enterprises on earth. The Intellipaat AWS course is completely oriented towards the practical applications and hence gives you a clear advantage.