2020年4月4日 星期六

[AWS / Docker] Update Docker Images only in ECS Tasks

Background
So here is the problem, usually web applications needs updating, and more often the update is not about server setup, but application content, like updating the product images, prices etc. In this case, docker images needs to be updated, well of course, we need to rebuild and push the images to AWS docker registry again. But how do we update the service to reflect the new changes of the mounted images?

Solutions
We used "update-service" command, and "force-deployment" to force update the docker images although they are with the same tags.
aws ecs update-service --service my-service --force-new-deployment --cli-input-json myConfigJson

where service is the AWS service name and cli-input-json parameter specifies other useful attributes needed.

References

沒有留言:

張貼留言