title: Cannot perform an interactive login from a non TTY device while trying to connect Docker to ECS repository
body: <p>I am trying to push a local docker image into the ECS repository I created.</p>
  <p>Following this link <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html" rel="nofollow noreferrer">link</a></p>
  <pre><code>aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com --profile loadeo
  </code></pre>
  <p>Errors:</p>
  <pre><code>unknown flag: --profile
  Unable to locate credentials. You can configure credentials by running &quot;aws configure&quot;.
  </code></pre>
  <p>I also referred to the stack overflow question on this <a href="https://stackoverflow.com/questions/60583847/aws-ecr-saying-cannot-perform-an-interactive-login-from-a-non-tty-device-after">Question</a>.
  Here the accepted answer is to have awscli version two.
  I feel I have version 2 of cli</p>
  <pre><code>aws --version
  aws-cli/2.0.19 Python/3.7.7 Windows/10 botocore/2.0.0dev23
  </code></pre>
  <p>In the above command if I don't use --profile I get the error.</p>
  <pre><code>aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin xxxxxxxxxxxxxx.dkr.ecr.region.amazonaws.com
  
  
  
   Unable to locate credentials. You can configure credentials by running &quot;aws configure&quot;.
  Error: Cannot perform an interactive login from a non TTY device
  </code></pre>
  <p>What is that I am missing here? Could any one please help me out with this?</p>