Search code examples
amazon-ecsamazon-ecrautodeploy

AWS ECS does not update a container with latest source code from ECR


I have ESC service with EC2 task running on an EC2 instance. I am building and pushing docker image into ECR using GitHub Actions.

The ECS task has been updated with latest ECR image, but the problem is that the task has not been updated as latest source code.

When I pulled ECR latest docker image onto my local and run, it is working correctly with updated code. But, on ECS, it is not.

Anyone, please guide me why it has been happening and what is solution.


Solution

  • I resolved it. It was caused by that I mounted app root into EFS volume. So it was replacing an ECS container with old code on EFS volume, although ECS agent pull new docker image from ECR.