# 2020/12/18\_push docker image to aws

***push docker images to Amazon ECR in Windows***

* install aws CLI 2&#x20;

<https://docs.aws.amazon.com/zh_cn/cli/latest/userguide/install-cliv2.html>

* aws configure

```bash
aws configure
```

remove `.docker/config.json` line if have `"credsStore": "wincred"`

* use aws password to login docker

```bash
aws ecr get-login-password --region region | docker login --username AWS --password-stdin accountid.dkr.ecr.region.amazonaws.com
```

```bash
aws ecr create-repository --repository-name name
```

```bash
docker push aws_account_id.dkr.ecr.region.amazonaws.com/imagename
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.lonelylty.com/coding/push_dockerimage_to_aws.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
