If your task is running under a service you can force a new deployment. This forces the task definition to be re-evaluated and the new container image to be pulled.

aws ecs update-service --cluster <cluster name> --service <service name> --force-new-deployment
Answer from Dima on Stack Overflow
🌐
Harness Developer Hub
developer.harness.io › continuous delivery & gitops › tutorials › aws deployments › deploy a docker image to amazon ecs
Deploy a Docker Image to Amazon ECS | Harness Developer Hub
April 8, 2026 - We can specify that image via the Harness by adding an Artifact Source. + Add Artifact Source. Select Docker Registry, we will select the Public Docker Hub Connector we re-wired before. Click Continue. Nginx can be used as an example to start. ... Click Submit and the Artifact will be wired in.
🌐
AWS
docs.aws.amazon.com › amazon ecs › developer guide › learn how to create and use amazon ecs resources › creating a container image for use on amazon ecs
Creating a container image for use on Amazon ECS - Amazon Elastic Container Service
3 weeks ago - Docker is a technology that provides the tools for you to build, run, test, and deploy distributed applications in containers. Amazon ECS schedules containerized applications on to container instances or on to AWS Fargate. Containerized applications are packaged as container images.
Discussions

How do I deploy updated Docker images to Amazon ECS tasks? - Stack Overflow
What is the right approach to make my Amazon ECS tasks update their Docker images, once said images have been updated in the corresponding registry? ... If your task is running under a service you can force a new deployment. This forces the task definition to be re-evaluated and the new container image to be pulled. aws ... More on stackoverflow.com
🌐 stackoverflow.com
ECS newbie: Simplest way to deploy an existing app to ECS?
I hate to be “that guy” but take the time to learn how to properly deploy this using a task definition. The docker-compose to ECS deployment has never gone well for any of the customers I’ve seen try to use it outside the simplest of use cases. If you really want to try it out more I’d take a look at this blog which goes into detail using some other AWS tools but keep in mind they will cost you. https://aws.amazon.com/blogs/containers/automated-software-delivery-using-docker-compose-and-amazon-ecs/ More on reddit.com
🌐 r/aws
21
7
April 29, 2023
Publish and deploy docker image to AWS ECS
first tip move away from silly branch = env and use yaml environments, i consider that an anti-pattern. next, at a high level get yourself a service connection or two (depending on your config probably one for each environment) for your aws creds and publish your image to an ecr, then deploy to ecs. More on reddit.com
🌐 r/azuredevops
2
1
June 5, 2024
amazon web services - Deploy Docker Image on AWS ECS - Stack Overflow
I am trying to deploy a ECS cluster for browserless. However running into some issue which I cant solve. I will try to run you through what I did in the set up. Went into ECS, create cluster, chose More on stackoverflow.com
🌐 stackoverflow.com
🌐
AWS
docs.aws.amazon.com › aws hands-on tutorials › hands-on tutorials › deploy docker containers on amazon ecs
Deploy Docker Containers on Amazon ECS - Deploy Docker Containers on Amazon ECS
Amazon Elastic Container Service (Amazon ECS) is the AWS service you use to run Docker applications on a scalable cluster. In this how-to guide, you will learn how to run a Docker-enabled sample application on an Amazon ECS cluster behind a load balancer, test the sample application, and delete ...
🌐
Better Stack
betterstack.com › community › guides › web-servers › deploy-docker-aws
Deploying Docker Containers to AWS ECR/ECS (Beginner's Guide) | Better Stack Community
Services such as Amazon Elastic Compute Cloud (EC2), Amazon Relational Database Service (RDS), and Amazon Elastic Container Service (ECS) can drastically simplify the orchestration, scaling, and management of Docker containers, making it easier for users to deploy their containerized applications on AWS reliably and securely. This article will guide you through several possible methods of deploying your containerized applications on AWS. You'll start by preparing the Docker images for your application containers and setting up the necessary infrastructure (provisioning a relational database and configuring networking settings).
Top answer
1 of 12
234

If your task is running under a service you can force a new deployment. This forces the task definition to be re-evaluated and the new container image to be pulled.

aws ecs update-service --cluster <cluster name> --service <service name> --force-new-deployment
2 of 12
95

Every time you start a task (either through the StartTask and RunTask API calls or that is started automatically as part of a Service), the ECS Agent will perform a docker pull of the image you specify in your task definition. If you use the same image name (including tag) each time you push to your registry, you should be able to have the new image run by running a new task. Note that if Docker cannot reach the registry for any reason (e.g., network issues or authentication issues), the ECS Agent will attempt to use a cached image; if you want to avoid cached images from being used when you update your image, you'll want to push a different tag to your registry each time and update your task definition correspondingly before running the new task.

Update: This behavior can now be tuned through the ECS_IMAGE_PULL_BEHAVIOR environment variable set on the ECS agent. See the documentation for details. As of the time of writing, the following settings are supported:

The behavior used to customize the pull image process for your container instances. The following describes the optional behaviors:

  • If default is specified, the image is pulled remotely. If the image pull fails, then the container uses the cached image on the instance.

  • If always is specified, the image is always pulled remotely. If the image pull fails, then the task fails. This option ensures that the latest version of the image is always pulled. Any cached images are ignored and are subject to the automated image cleanup process.

  • If once is specified, the image is pulled remotely only if it has not been pulled by a previous task on the same container instance or if the cached image was removed by the automated image cleanup process. Otherwise, the cached image on the instance is used. This ensures that no unnecessary image pulls are attempted.

  • If prefer-cached is specified, the image is pulled remotely if there is no cached image. Otherwise, the cached image on the instance is used. Automated image cleanup is disabled for the container to ensure that the cached image is not removed.

🌐
Earthly
earthly.dev › blog › deploy-DockerContainers-with-ECS
Deploying Docker Containers with ECS - Earthly Blog
July 19, 2023 - On the View push commands modal, we are given a detailed guide to follow to successfully push our docker image to our repository. The push view has a series of instructions, let’s go over them. Firstly, we need to retrieve an authentication token which we will use to authenticate our docker client to our AWS repository. To do this, we will use the AWS CLI tool and run this command in our terminal · aws ecr-public get-login-password --region us-east-1 | \ docker login --username AWS --password-stdin <REPOSITORY-URI>
🌐
Reddit
reddit.com › r/aws › ecs newbie: simplest way to deploy an existing app to ecs?
r/aws on Reddit: ECS newbie: Simplest way to deploy an existing app to ECS?
April 29, 2023 -

I have forked an open source project and I would like to deploy it to ECS.

It has a docker-compose.yml .

Theoretically one can use such a file with ECS. But I have already run into three problems and I wonder if this is not really a reliable strategy. It seems to me that the ECS back-end for docker is poorly implemented.

I'll get to the main problem and you can skip the rambling after if you aren't interested in it.

The main problem is that I changed the docker-compose.yml to use ECR (because docker basically required me to). That works locally, but remotely I get:

$ docker --context default -D -l debug compose up 2>&1 | tee /tmp/logs_local.txt

FrontendTCP5173Listener  CreateComplete 
FrontendService  CreateInProgress 
FrontendService  CreateInProgress Resource creation Initiated
level=debug msg="Delete CloudFormation stack"
docsgpt  FrontendService EssentialContainerExited: Essential container in task exited
docsgpt  DeleteInProgress User Initiated
FrontendService  CreateFailed Resource creation cancelled
FrontendService  DeleteInProgress

I don't know how to get more information about the failure:

$ docker compose logs 
ResourceNotFoundException: The specified log group does not exist.

How do I figure out why the FrontendService exited?

===

That's the main problem. Here is the rambling about other problems that got me to this point which you can read or not, per your preference.

Starting from the original YML, it seems to require me to supply an image name in the iml instead of being able to just build into the cloud as in the original yml.

$  docker compose up
 WARNING [services.build](https://services.build): unsupported attribute
 service frontend doesn't define a Docker image to run: incompatible attribute

So I already need to change the docker-compose, which is at odds with Amazon's message that you can just use your docker-compose as-is.

This brings me to the next issue: even the slightest typo in the docker-compose.yml causes a silent failure. Which is horrible UX for a developer CLI. I can work around it, but it degrades my confidence in the tooling and makes me think that it might not be properly supported and implemented.

Anyhow, I want to add an image: line to my file.

It's unclear whether the images in my "default" local context are available in the "ecs" context because `docker compose images` says:

$ Command "compose images" not available in current context (awsdocgen). "not implemented"

Lots of commands are not implemented in this context. Another thing lowering my confidence level.

So I add the image: line to my file based on my local image ID: `image: 2d36783e9f21`

Now I get:

 INFO trying next host                              error="pull access denied, repository does not exist or may require authorization: server message: insufficient\_scope: authorization failed" [host=registry-1.docker.io](https://host=registry-1.docker.io)
pull access denied, repository does not exist or may require authorization:
server message: insufficient\_scope: authorization failed

I think it's trying to look for my image on docker hub, whereas I want it to use my local one.

So my second question is: Can I do this without using ECR and putting ECR image names in my docker-compose.yml?

Find elsewhere
🌐
Reddit
reddit.com › r/azuredevops › publish and deploy docker image to aws ecs
r/azuredevops on Reddit: Publish and deploy docker image to AWS ECS
June 5, 2024 -

Hi! I have an azure repo of a simple website that has a Dockerfile which I'm building with my Azure Pipelines

I want to publish that project into my aws ecs, and I was thinking of doing it with the azure pipelines releases, but since my account is free, it seems it doesn't have this option.

trigger:
  branches:
    include:
      - dev
      - prod

pool: my-laptop

variables:
  - name: imageName
    value: prueba
  - name: environment_name
    ${{ if eq(variables['Build.SourceBranchName'], 'dev') }}:
      value: dev
    ${{ if eq(variables['Build.SourceBranchName'], 'prod') }}:
      value: prod

stages:
  - stage: Build
    jobs:
    - job: Build
      displayName: Build Job
      steps:
      - task: Docker@2
        displayName: Build an image
        inputs:
          repository: $(imageName)
          command: build
          Dockerfile: Dockerfile

This is my pipeline for now.

Thank you!

🌐
Medium
medium.com › @obaff › how-to-deploy-a-docker-image-on-aws-ecs-c71c7e1c00ce
How to Deploy a Docker Image on AWS ECS | by Obafemi | Medium
November 15, 2024 - How to Deploy a Docker Image on AWS ECS AWS ECS is a container orchestration service that allows you to deploy, manage, and scale Docker containers in the AWS cloud. ECS can run containers on AWS …
🌐
AWS
aws.amazon.com › blogs › devops › build-and-deploy-docker-images-to-aws-using-ec2-image-builder
Build and Deploy Docker Images to AWS using EC2 Image Builder | AWS DevOps & Developer Productivity Blog
May 22, 2021 - The NFL, in conjunction with AWS Professional Services, delivered an EC2 Image Builder pipeline for automating the production of Docker images. Following similar practices from the Digital Athlete Program, this post demonstrates how to deploy an automated Image Builder pipeline.
🌐
CTO.ai
cto.ai › blog › deploying-a-docker-application-to-aws-ecs
Deploying a Docker Application to AWS ECS
January 19, 2022 - Tag your image so you can push it to the repository using the tag command docker tag express-app:latest public.ecr.aws/c6k2k2p8/express-app:latest
🌐
Medium
kevinkiruri.medium.com › deploying-a-container-with-amazon-ecs-d95dcab8b411
Deploying a container with Amazon ECS | by Kevin Kiruri | Medium
December 6, 2023 - 3. For the infrastructure, choose AWS Fargate (serverless). In the event you wish to create your own EC2s for the project, select Amazon EC2 instances and proceed. ... On the left navigation plane, click on Task definitions and click on Create new task definition then select Create new task definition ... 3. Under the container details, give the container a name and the repository url (eg the url to a public docker image on dockerhub).
🌐
OneUptime
oneuptime.com › home › blog › how to deploy a docker container on ecs with fargate
How to Deploy a Docker Container on ECS with Fargate
February 12, 2026 - # Get the ECR login token and authenticate Docker aws ecr get-login-password --region us-east-1 | \ docker login --username AWS --password-stdin 123456789.dkr.ecr.us-east-1.amazonaws.com # Build the image docker build -t my-api:1.0.0 .
🌐
Towards Data Science
towardsdatascience.com › home › latest › deploying a docker container with ecs and fargate.
Deploying a Docker container with ECS and Fargate. | Towards Data Science
January 29, 2025 - The three AWS technologies we are going to use here are Elastic Container Service (ECS), Elastic Container Registry (ECR), and Fargate. ECS is the core of our work. In ECS we will create a task and run that task to deploy our Docker image to a container. ECS also handles the scaling of applications that need multiple instances running.
🌐
Earthly
earthly.dev › blog › deploy-dockcontainers-to-AWSECS-using-Terraform
Deploying Docker Containers to AWS ECS Using Terraform - Earthly Blog
July 19, 2023 - Re-run the apply command to add these changes to AWS: ... The image is now hosted in the ECR, but to run the image, you need to launch it onto an ECS container. To deploy the image to ECS, you first need to create a task. A task tells ECS how ...
🌐
Medium
medium.com › @Rushabh_ › deploying-docker-container-on-aws-ecs-6821af1ea712
Deploying Docker Container on AWS ECS | by Rushabh Dabhade | Medium
November 11, 2024 - Here’s a detailed guide for an article titled Deploying Docker Container on AWS ECS. This guide will walk through creating a Node.js app, containerizing it with Docker, building and testing a multi-stage Docker image, pushing it to AWS ECR, setting up an ECS cluster, and finally deploying the container on AWS ECS with a focus on scaling, health checks, and rolling updates.
🌐
Medium
aws.plainenglish.io › deploying-a-docker-container-in-aws-using-fargate-5a19a140b018
Deploying a Docker container with ECS and Fargate | by Esteban Pierotti | AWS in Plain English
July 30, 2024 - Click on “Get Started” to set up a new repository to store your Docker images. Give it a meaningful name, such as “my-web-app,” scroll all the way to the end, and click “Create repository.” ... aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <your-account-id>.dkr.ecr.<region>.amazonaws.com
🌐
Medium
aws.plainenglish.io › simple-guide-to-deploy-docker-container-in-ecs-fargate-behind-alb-4fc6b5c12f8b
Simple Guide to Deploy Docker Container in ECS Fargate behind ALB | by Kavindu Vindika | AWS in Plain English
January 22, 2024 - ... Since I’m using docker desktop, I can view it in UI as well. ... Now run docker image creating a container exposing the application at host port 8080. ... Before this, you might need to setup your security credentials to access AWS via CLI.