<p>The image versions are defined in task definition, so you'll have to create a new task definition (or update the existing one) changing the Docker image tag.</p>
<p>See <a href="https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-task-definition.html" rel="nofollow noreferrer">AWS docs</a> for a task definition template.</p>

CC BY-SA 4.0
2021-09-08T19:38:03.277Z
2021-09-08T19:38:03.277Z
Sathyajith Bhat
<p>We run services in AWS FARGATE... our Docker builds are tagged before we push them to AWS with a <code>Makefile</code>.</p>
<p>I committed changes to a Docker service, ran <code>make</code>, and I see the new Docker image tag when I run <code>aws ecr --profile staging --region us-east-1  describe-images --repository-name &quot;bind&quot;</code>:</p>
<pre><code>{
    &quot;registryId&quot;: &quot;8675309&quot;,
    &quot;repositoryName&quot;: &quot;bind&quot;,
    &quot;imageDigest&quot;: &quot;sha256:0d3f8d5341286a8e8eb4ddfff2865638b35f8ff83823f8c2cee4bad359d0ffff&quot;,
    &quot;imageTags&quot;: [
        &quot;0.0.3-0.20210825120405-81e9cffff200&quot;
    ],
    &quot;imageSizeInBytes&quot;: 105228639,
    &quot;imagePushedAt&quot;: &quot;2021-08-25T12:05:02-05:00&quot;,
    &quot;imageManifestMediaType&quot;: &quot;application/vnd.docker.distribution.manifest.v2+json&quot;,
    &quot;artifactMediaType&quot;: &quot;application/vnd.docker.container.image.v1+json&quot;
},
</code></pre>
<p>I am rather new to FARGATE, and I can't figure out the <code>aws</code> CLI to replace the current (outdated) Docker image.  Which commands should I run?  I'm open to using <code>aws</code> CLI or <code>boto</code>.</p>

<amazon-web-services><python><aws-cli><fargate>
AWS FARGATE ECS - Exact steps to deploy new Docker images with aws CLI
Mike Pennington
# AWS FARGATE ECS - Exact steps to deploy new Docker images with aws CLI

(Asked by: username_0 on 2021-09-03)

We run services in AWS FARGATE... our Docker builds are tagged before we push them to AWS with a Makefile.
I committed changes to a Docker service, ran make, and I see the new Docker image tag when I run aws ecr --profile staging --region us-east-1  describe-images --repository-name "bind":
{
    "registryId": "8675309",
    "repositoryName": "bind",
    "imageDigest": "sha256:0d3f8d5341286a8e8eb4ddfff2865638b35f8ff83823f8c2cee4bad359d0ffff",
    "imageTags": [
        "0.0.3-0.20210825120405-81e9cffff200"
    ],
    "imageSizeInBytes": 105228639,
    "imagePushedAt": "2021-08-25T12:05:02-05:00",
    "imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "artifactMediaType": "application/vnd.docker.container.image.v1+json"
},

I am rather new to FARGATE, and I can't figure out the aws CLI to replace the current (outdated) Docker image.  Which commands should I run?  I'm open to using aws CLI or boto.

**Tags:** amazon-web-services, python, aws-cli, fargate


---

## 1 answers

### Answer by username_1 on 2021-09-08. Score: 1

The image versions are defined in task definition, so you'll have to create a new task definition (or update the existing one) changing the Docker image tag.

See [AWS docs](https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-task-definition.html) for a task definition template.


---

