Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update container image in AWS Fargate

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.

like image 412
Ram Avatar asked Jan 04 '18 16:01

Ram


People also ask

Does fargate cache images?

Fargate does not cache images, and therefore the whole image is pulled from the registry when a task runs.

What's new in AWS Fargate for Amazon ECS?

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).

What is AWS Fargate in Docker?

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.

How to build images using kaniko with Amazon ECS on AWS Fargate?

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.

How to update service with new container?

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.


Video Answer


2 Answers

As simple as:

aws ecs update-service --cluster <cluster> --service <service> --force-new-deployment

like image 83
Gabriel Petersson Avatar answered Sep 20 '22 12:09

Gabriel Petersson


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

like image 28
Krzysztof Czelusniak Avatar answered Sep 18 '22 12:09

Krzysztof Czelusniak