Search code examples
dockeramazon-ecs

Amazons EC2 container service - are tasks deployed as docker containers inside docker containers?


I have been reading this overview on Amazon's EC2 container service. One thing that is confusing me is how tasks are deployed onto an EC2 cluster. Assume a task definition contains 2 container instances, 1 for wordpress and 1 for mysql. The following diagram shows an overview of the setup:

enter image description here

This shows the 2 tasks in a container instance. Is the container instance simply an EC2 VM? Or is it a docker container running on an EC2 instance? Further, the 2 tasks here are docker containers as well and they run on a docker container?

The source of the confusion arises from another diagram further on in the overview, as shown below:

enter image description here

In this case, they are referred to as 'Cluster instances'.


Solution

  • A container instance is an EC2 instance that is running the ECS agent. You can launch the ECS-optimized AMI for a preconfigured system, or you can use your own AMI if you prefer.

    Tasks are one or more containers deployed together. Tasks are defined with task definitions. Tasks are not deployed as containers-inside-containers (Docker-in-Docker), but are just sets of containers running on your container instance.

    The "cluster instances" term looks to be a typo. I've reached out to our doc writers to get that corrected.