2

I am currently using ECS to deploy a web application. This Application is pushed on my ECR with the latest tag but putting new images doesn't seem to change the code at deployment.

I tried to use the answer found here How do I deploy updated Docker images to Amazon ECS tasks? using aws ecs update-service --cluster <cluster name> --service <service name> --force-new-deployment.

I also put ECS_IMAGE_PULL_BEHAVIOR=always in my ecs config and deployment_minimum_healthy_percent = 0 and deployment_maximum_percent = 200 in my deployment settings.

I notice that the image digest is matching the latest image, but by logging on the container, the code is not different from the previous version. But by executing docker pull <my_image:latest> the changes are there.

Viak
  • 59
  • 6
  • What issue did you have with that AWS CLI command? Did it not update the service with your new latest image? – ydaetskcoR Jul 06 '21 at 09:31
  • 1
    The service is updated but the code running is different from what it should be: executing docker pull on my image and running it locally doesn't run the same code.. – Viak Jul 06 '21 at 09:40

1 Answers1

1

You need to update task definition first (create new one) and then deploy it.

ECS task definition
CLI for register task

Eugene S.
  • 11
  • 1
  • Then I would have to update a nes task definition without any change in it ? Since the image url would be the same (`012345678910.dkr.ecr.region-name.amazonaws.com/repository-name:latest`) ? – Viak Jul 08 '21 at 08:51
  • 1
    I tried updating the task definition without any change, and my code is still not updated – Viak Jul 08 '21 at 09:00
  • So may be this will help you: https://stackoverflow.com/questions/56081320/how-does-latest-tag-work-in-an-ecs-task-definition-and-container-instances-pul – Eugene S. Jul 08 '21 at 17:08