Amazon ECS Linux container agent
Each Amazon ECS container agent version supports a different feature set and provides bug fixes from previous versions. When possible, we always recommend using the latest version of the Amazon ECS container agent. To update your container agent to the latest version, see Updating the Amazon ECS container agent.
To see which features and enhancements are included with each agent release, see https://github.com/aws/amazon-ecs-agent/releases
Important
The minimum Docker version for reliable metrics is Docker version v20.10.13
and
newer, which is included in Amazon ECS-optimized AMI 20220607
and newer.
Amazon ECS agent versions 1.20.0
and newer have deprecated support for
Docker versions older than 1.9.0
.
Lifecycle
When the Amazon ECS container agent registers an Amazon EC2 instance to your cluster, the Amazon EC2
instance reports its status as ACTIVE
and its agent connection status as
TRUE
. This container instance can accept run task requests.
If you stop (not terminate) a container instance, the status remains ACTIVE
, but
the agent connection status transitions to FALSE
within a few minutes. Any tasks
that were running on the container instance stop. If you start the container instance again,
the container agent reconnects with the Amazon ECS service, and you are able to run tasks on the
instance again.
Important
If you stop and start a container instance, or reboot that instance, some older versions
of the Amazon ECS container agent register the instance again without deregistering the original
container instance ID. In this case, Amazon ECS lists more container instances in your cluster
than you actually have. (If you have duplicate container instance IDs for the same Amazon EC2
instance ID, you can safely deregister the duplicates that are listed as
ACTIVE
with an agent connection status of FALSE
.) This issue
is fixed in the current version of the Amazon ECS container agent. For more information about
updating to the current version, see Updating the Amazon ECS container agent.
If you change the status of a container instance to DRAINING
, new tasks are not
placed on the container instance. Any service tasks running on the container instance are
removed, if possible, so that you can perform system updates. For more information, see Container instance draining.
If you deregister or terminate a container instance, the container instance status changes to
INACTIVE
immediately, and the container instance is no longer reported when
you list your container instances. However, you can still describe the container instance for
one hour following termination. After one hour, the instance description is no longer
available.
Important
You can drain the instances manually, or build an Auto Scaling group lifecycle hook to set the
instance status to DRAINING
. See Amazon EC2 Auto Scaling lifecycle hooks
for more information about Auto Scaling lifecycle hooks.
Amazon ECS-optimized AMI
The Linux variants of the Amazon ECS-optimized AMI use the Amazon Linux 2 AMI as their base. The Amazon Linux 2 source AMI name for each variant can be retrieved by querying the Systems Manager Parameter Store API. For more information, see Retrieving Amazon ECS-Optimized AMI metadata. When you launch our container instances from the most recent Amazon ECS-optimized Amazon Linux 2 AMI you receive the current container agent version. To launch a container instance with the latest Amazon ECS-optimized Amazon Linux 2 AMI, see Launching an Amazon ECS Linux container instance.
Additional information
The following pages provide additional information about the changes:
-
Amazon ECS Agent changelog
on GitHub -
The source code for the
ecs-init
application and the scripts and configuration for packaging the agent are now part of the agent repository. For older versions ofecs-init
and packaging, see Amazon ecs-init changelogon GitHub -
Docker Engine release notes
in the Docker documentation -
NVIDIA Driver Documentation
in the NVIDIA documentation