I have pushed the initial docker image into repository and created AWS Fargate using the image, is there any way to update the image as there are certain changes in my docker image.
Fargate does not cache images, and therefore the whole image is pulled from the registry when a task runs.
With the latest update to the metadata service, tasks running on AWS Fargate for Amazon ECS can now access more detailed network metrics from the container, specifically around bytes transmitted per second (Tx and Rx).
In this final article of this series, we will look into using the Docker image and deploying the application using AWS Fargate. AWS Fargate is a technology for Amazon ECS and EKS that allows you to run containers without having to manage servers or clusters.
To build images using kaniko with Amazon ECS on AWS Fargate, you would need: An existing AWS VPC and Subnet. The ECS tasks deployed in this subnet will also need access to your application’s source code repository. This could be a public GitHub repository; if so, the subnets would need internet access.
To update service with new container, you need to: important: make sure service rules allow launching new version of the task. If service task is not updated to latest version, check "events" tab for errors.
As simple as:
aws ecs update-service --cluster <cluster> --service <service> --force-new-deployment
See AWS documentation:
If you have updated the Docker image of your application, you can create a new task definition with that image and deploy it to your service.
Note
If your updated Docker image uses the same tag as what is in the existing task definition for your service (for example, my_image:latest), you do not need to create a new revision of your task definition. You can update the service using the procedure below, keep the current settings for your service, and select Force new deployment. The new tasks launched by the deployment pull the current image/tag combination from your repository when they start. The Force new deployment option is also used when updating a Fargate task to use a more current platform version when you specify LATEST. For example, if you specified LATEST and your running tasks are using the 1.0.0 platform version and you want them to relaunch using a newer platform version.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/update-service.html#update-service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With