Quantcast
Channel: AWS - ECS - How can I redeploy an updated Docker image on an existing ECS (with 1 EC2) instance? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Rex Lam for AWS - ECS - How can I redeploy an updated Docker image on an existing ECS (with 1 EC2) instance?

$
0
0

If you don't specify the tag of an ECR image on your container definition, it will always fetch the latest one. Thus, you have 2 ways to achieve the re-deployment.

  1. Make sure your service having enough room to deploy a new task, for example, if your desired Number of tasks is 1, then you have to set the Maximum percent to 200, means you can allow 1 * 200% = 2 tasks running at the same time while doing the deployment, then simply type the following command: aws ecs update-service --cluster <cluster name> --service <service name> --force-new-deployment

  2. Or after you update your image to ECR, you can just manually kill the existing task(s) and create a new one (normally the creation process should be done by the ECS itself, as long as your auto scaling configuration is setup correctly).


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>