> For the complete documentation index, see [llms.txt](https://note.lonelylty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://note.lonelylty.com/coding/push_dockerimage_to_aws.md).

# 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
```
