5

What is the difference between an AWS EC2 instance and a docker container instance? When should I use one over the other?

nz_21
  • 4,552
  • 5
  • 24
  • 57
  • The answers to [How is Docker different from a virtual machine?](https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine?rq=1) cover a lot of this ground; in the EC2 case Amazon is hosting the VM. – David Maze Oct 22 '20 at 23:12

1 Answers1

3

When you get an EC2 instance it will provide the base installation of that specific operating system with some additional AWS packages installed such as the SSM Agent.

There are then AMIs that are prepared for specific usecases such as SQL Server, or in this case pre-configured with AWS Orchestration services (either ECS or EKS) which have the usecase software installed.

If you're not familiar with Docker I would suggest running it in your local environment first so that you can become familiar with it. Yes people have been moving towards containers and serverless but you need to ensure you are able to support this in production.

With containers being deployed you will need to understand the orchestration layer that you're using. It's very easy to see containers as an alternative to a virtualisation layer, but there are many differences to how these operate.

Take a look at the What is Docker? page for further explanations.

Chris Williams
  • 27,937
  • 4
  • 22
  • 50