title: aws ecr saying "Cannot perform an interactive login from a non TTY device" after copied cmd from "Amazon Container Services"
body: <p>I am trying to set up docker image of amazon ECR on <code>ubuntu18.04</code> machine of AWS,using commands provided by <code>view push commands</code> of <code>Amazon Container Services</code>
  <a href="https://i.stack.imgur.com/x8w8O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/x8w8O.png" alt="view push commands of amazon container services"></a></p>
  
  <p>,please note i have already set up <code>docker</code> on my <code>ubuntu18.04</code> and also output of <code>docker -v</code> is as below</p>
  
  <pre><code>ubuntu@ip-172-31-0-143:~$ docker -v
  Docker version 19.03.7, build 7141c199a2
  </code></pre>
  
  <p>When i execute the command provided by amazon container services on aws cli on ubuntu18.04 i get error as
      Error: Cannot perform an interactive login from a non TTY device</p>
  
  <p>The command which i am using is </p>
  
  <pre><code>aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 8233251134332.dkr.ecr.us-east-2.amazonaws.com/gatling-lots
  </code></pre>
  
  <p>please note i have successfully configured awscli and i can see the
  detailed  from <code>aws s3 ls</code></p>
  
  <p>Here is detailed error log</p>
  
  <pre><code>ubuntu@ip-172-31-0-143:~$ aws ecr get-login-password --region us-   
  east-2 | docker login --username AWS --password-stdin 
  823443336.dkr.ecr.us-west-2.amazonaws.com/gatling-lots
  usage: aws [options] &lt;command&gt; &lt;subcommand&gt; [&lt;subcommand&gt; ...]      
  [parameters]
   To see help text, you can run:
  
  aws help
  aws &lt;command&gt; help
  aws &lt;command&gt; &lt;subcommand&gt; help
  aws: error: argument operation: Invalid choice, valid choices are:
  
   batch-check-layer-availability           | batch-delete-image                      
   batch-get-image                          | complete-layer-upload                   
  create-repository                        | delete-lifecycle-policy                 
  delete-repository                        | delete-repository-policy                
   describe-images                          | describe-repositories                   
   get-authorization-token                  | get-download-url-for-layer              
   get-lifecycle-policy                     | get-lifecycle-policy-preview            
   get-repository-policy                    | initiate-layer-upload                   
   list-images                              | put-image                               
   put-lifecycle-policy                     | set-repository-policy                   
   start-lifecycle-policy-preview           | upload-layer-part                       
   get-login                                | help                                    
   Error: Cannot perform an interactive login from a non TTY device
  </code></pre>
  
  <p>output of</p>
  
  <pre><code>ubuntu@ip-172-31-0-143:~$ (aws ecr get-login --no-include-email  --region us-east-2)
  
  docker login -u AWS -p 
  
  MzQxL2c0Yks4RjVxeDg9IiwidmVyc2lvbiI6IjIiLCJ0eXBlIjoiREFUQV9LRVkiLCJleHBpcmF0aW9uIjoxNTgzNjgzNDY5fQ== https://825251119036.dkr.ecr.us- east-2.amazonaws.com
  </code></pre>