ECS updating service with same tasks but different docker image

I am an issue that either I do not understand well or something weird happening with aws ecs service.

I update my code, create a new docker image and push it to be deployed using ECS. The issue is, when the task definition does not changes, the code does not get deployed, even though the image in ECR got updated. How can get my code deployed then? I am assuming that when the image has changed, the services is run the already registered tasks which should pull the image right?

  • Unable to deploy Docker composer to AWS ECS
  • How to define multiple tasks in elastic beanstalk docker json
  • Can't push image to Amazon ECR - fails with “no basic auth credentials”
  • Docker data-only container on AWS ECS
  • Concourse CI Pipeline giving error :- Get net/http: request canceled while waiting for connection
  • How to manage deployment?
  • Example of commands I run

    aws ecs register-task-definition --cli-input-json file:///deploy/tasks/my-task-definition.json
    aws ecs update-service --service my-service --cluster my-clusdter --task-definition my-task-defintion

    The first time I run these commands, the code is deployed, if I update my code, push the new image to the Registry, then run these commands, my code does not get deployed.

  • Deploying Docker to AWS Elastic Beanstalk — how to forward port to host? (port binding)
  • Serving Jupyter Notebook from within docker container on AWS not working?
  • Using Spinnaker to deploy a Docker image from dockerhub to Aws Eb
  • Running multiple docker instances in EC2
  • Error deploying Play Framework on AWS Beanstalk Docker
  • Docker: Different ENV variables for development and production environments
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.