Upgrading an Amazon ECS cluster to Docker 1.9

Published: 2016-01-14
As announced yesterday, Amazon ECS now supports Docker 1.9 (1.9.1 actually). Woohoo.

In order to benefit from this update, a cluster must use the latest ECS-optimized Amazon Machine Image (AMI), which embeds Docker 1.9.1 and ECS Agent version 1.7.1. As a sidenote, if you want to pull Docker images from Amazon ECR, your agent version must be at least 1.7.0, so that's probably another reason to upgrade :)

The AMI you're looking for is amzn-ami-2015.09.d-amazon-ecs-optimized. The AMI id varies from one region to the next, here's the full table. For eu-west-1, the id is ami-03238b70

Here's a simple way to upgrade a cluster:

1) Go to the EC2 console and locate the Launch Configuration used by the Auto Scaling group for your ECS instances.

2) Click "Copy Launch Configuration" to create a copy.

3) Click "Edit AMI" and using the AMI id from the table above, search and select the new AMI.

4) Leave everything else unchanged and create the launch configuration. You should now see something similar to this:

Technical illustration

5) Edit the Auto Scaling group. The first step is to replace the old launch configuration with the new one

Technical illustration

Let's say you have 5 ECS instances in the cluster. The next step is then to start 5 new ECS instances in order to replace the older ones while providing enough capacity for all your tasks: edit 'Desired' (and possibly 'Max') to 10 and save.

Within a few minutes, you will have 10 instances running:

Technical illustration

6) Deregister the old instances. In the ECS console, go through each one of the old instances and click 'Deregister' to remove them from the cluster. At this point, the ECS scheduler will launch tasks as needed on the new instances. Don't have to worry about your containers, they will quickly find a new home :)

7) Terminate the old instances. In the EC2 console, select all the old instances and terminate them.

8) Resize the Auto Scaling group. Go back to the Auto Scaling group and set the right values for 'Desired' and 'Max'.

Job done. This should be a quick and seamless operation. Happy to hear your feedback!

About the Author

Julien Simon is the Chief Evangelist at Arcee AI , specializing in Small Language Models and enterprise AI solutions. Recognized as the #1 AI Evangelist globally by AI Magazine in 2021, he brings over 30 years of technology leadership experience to his role.

With 650+ speaking engagements worldwide and 350+ technical blog posts, Julien is a leading voice in practical AI implementation, cost-effective AI solutions, and the democratization of artificial intelligence. His expertise spans open-source AI, Small Language Models, enterprise AI strategy, and edge computing optimization.

Previously serving as Principal Evangelist at Amazon Web Services and Chief Evangelist at Hugging Face, Julien has helped thousands of organizations implement AI solutions that deliver real business value. He is the author of "Learn Amazon SageMaker," the first book ever published on AWS's flagship machine learning service.

Julien's mission is to make AI accessible, understandable, and controllable for enterprises through transparent, open-weights models that organizations can deploy, customize, and trust.