title: can't push image to ECR even though login in docker and was successfully
body: <p>When attempting to push image to ECR, I always get 'no basic auth' error. ECR is in us-east-1. </p>
  
  <p>This is login command </p>
  
  <pre><code>aws ecr get-login --region us-east-1 --no-include-email
  </code></pre>
  
  <p>I get response like this</p>
  
  <pre><code>docker login -u AWS -p eyJwYXl ... 
  </code></pre>
  
  <p>I copy this response and run command, than I got this response</p>
  
  <pre><code>Login Succeeded
  </code></pre>
  
  <p>I assume that I logged in AWS and docker successfully, so I try to push image to ECR</p>
  
  <pre><code>docker push AWSID.dkr.ecr.us-east-1.amazonaws.com/repositoryname
  </code></pre>
  
  <p>Than response is like this</p>
  
  <pre><code>ed9f73170eb1: Preparing
  f26c0d1885c7: Preparing
  254cc70ba305: Preparing
  6bfcbc08ecad: Preparing
  0cb1addb8efc: Preparing
  f9109426e338: Waiting
  b7f99d06d826: Waiting
  24d803cb9c1a: Waiting
  25c4f6422338: Preparing
  69b416623121: Waiting
  0753f0746a0d: Waiting
  a20143cd0986: Waiting
  3028f693c3e6: Waiting
  514a0f74b55d: Waiting
  no basic auth credentials
  </code></pre>
  
  <p>To figure out what causes error, I checked <code>~/.docker/config.json</code>. my config.json is like this.</p>
  
  <pre><code>{
  "auths": {
      "AWSPATH.dkr.ecr.us-east-1.amazonaws.com": {
          "auth": "QVd..},
      "https://index.docker.io/v1/": {}
         },
  "HttpHeaders": {
      "User-Agent": "Docker-Client/19.03.5 (darwin)"
  }
  </code></pre>