14

I am using Mobaxterm and starting a local bash terminal, and trying this command. But seeing an error. The same command is working from the cmd windows prompt or powershell. Any suggestions on workarounds, really appreciate it. I played with some settings that are already in the mobaxterm, but none worked.

/home/mobaxterm>docker login abcdef.azurecr.io
Error: Cannot perform an interactive login from a non TTY device

6 Answers 6

11

Try adding winpty before the docker ... command.

It enables TTY on Windows. Useful for GitBash, Putty and MobaXTerm.

$ winpty docker login $ACR_REGISTRY
Username: appacr
Password:
Login Succeeded
1
  • Does anyone know the MacOS equivalent?
    – Woodsman
    Nov 7, 2020 at 22:30
3

This is a docker error. Each Repo needs to have it's own environment variables set up. If you don't set up the DOCKER_USERNAME and DOCKER_PASSWORD in your model in the Repository settings, it would raise that confusing docker terminal (tty) error.

3

Use the --password-stdin flag as specified in the docs.

aws ecr get-login-password | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
2

For me, the issue was with AWS ECR and I simply needed to update my aws cli.

AWS-CLI, version 2 installation instructions for Mac: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html

You'll find similar instructions for other OS's there as well.

0

Try specifying the region in the aws ecr statement such as this example provided here:

aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com

When I tried this to resolve the error I also noticed that AWS is finicky (unwilling to accept reasonable mistakes, for the non-english-native users) about how you define the region variable though. For example, us-west-2, while good enough in the --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com part of the call, needed to be specified further as us-west-2b within the aws ecr get-login-password --region region portion of the command.

Hope this helps!

-2

I had same issue on m1 Mac and the solution is refreshing the artifactory token.

2
  • 6
    Welcome to the site, and thank you for your contribution. Please consider expanding your answer by adding instructions on how to do this. Also, you may want to explain why you think the token is the cause behind the OP's problem.
    – AdminBee
    Feb 1, 2023 at 15:23
  • 1
    Welcome to Unix & Linux! Your answer is a bit terse and could be improved by explaining the issue, i.e., the underlying cause of the problem and why your solution correctly would resolve it for the user in the question.
    – Kusalananda
    Feb 7, 2023 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .