title: Could not connect to the endpoint URL: "https://api.ecr-public.xxxxxxxxx.amazonaws.com/"
body: <p>I have an <a href="https://docs.aws.amazon.com/AmazonECR/latest/public/what-is-ecr.html" rel="nofollow noreferrer">Amazon ECR Public</a> repository which is created in the <code>ap-southeast-2</code> region. I tried to log in to the <code>ecr-public</code> with the following command.</p>
  <pre class="lang-sh prettyprint-override"><code>aws ecr-public get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin public.ecr.aws/&lt;default_alias&gt;
  </code></pre>
  <p>But I'm getting the following error,</p>
  <pre class="lang-sh prettyprint-override"><code>Could not connect to the endpoint URL: &quot;https://api.ecr-public.ap-southeast-2.amazonaws.com/&quot;
  Error: Cannot perform an interactive login from a non TTY device
  </code></pre>
  <p>Why I'm getting this error?</p>
  <hr />
  <p>I've configured the AWS credentials via CLI and I could log in to the <code>ecr</code> private repositories in the same region using the following command.</p>
  <pre class="lang-sh prettyprint-override"><code>aws ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin &lt;accound_id&gt;.dkr.ecr.ap-southeast-2.amazonaws.com
  </code></pre>
  <p>Didn't get any errors.</p>
  <pre class="lang-sh prettyprint-override"><code>WARNING! Your password will be stored unencrypted in /home/wasdkiller/.docker/config.json.
  Configure a credential helper to remove this warning. See
  https://docs.docker.com/engine/reference/commandline/login/#credentials-store
  
  Login Succeeded
  </code></pre>
  <p>I tried most of the solutions mentioned in the following articles but couldn't solve my problem.</p>
  <ul>
  <li><a href="https://stackoverflow.com/q/60583847/6194097">aws ecr saying &quot;Cannot perform an interactive login from a non TTY device&quot; after copied cmd from &quot;Amazon Container Services&quot;</a></li>
  <li><a href="https://community.atlassian.com/t5/Bitbucket-questions/Piplenes-docker-login-can-not-perform-an-interactive-login-from/qaq-p/595736" rel="nofollow noreferrer">Piplenes: docker login can not perform an interactive login from a non TTY</a></li>
  </ul>