suanziliu
suanziliu

Reputation: 157

AWS ECS Cluster: how to update a single docker if its task definition has many other containers

I'm using AWS ECS to deploy Spring Cloud MSA by using 3 ec2 instances. 2 instances is used to run spring-cloud services, like consul server, AP1, AP2, spring-gateway. Another one is an instance in small type which only runs consul server.

I have 2 task definitions:

One for deploying Consul which performs as service discovery and config server.

Another task definition is used to deploy dockers, like AP1, AP2, spring-gateway.

My question is that, in the second task definition, how can I only update AP1 amoung multiple containers if a new docker image is created?

I tried to create a new revision of the second task definition, then update the service. But seems like all docker containers defined in the task difinition are updated, but not the single 1 which changed docker image.

Upvotes: 1

Views: 636

Answers (1)

Adiii
Adiii

Reputation: 60074

You can not update one container if the are sharing the same task definition. better to place these containers in the separate task definition.

enter image description here

This because all container is part of single task definition, and each task definition run by service.

Upvotes: 1

Related Questions