Piplenes: docker login can not perform an interactive login from a non TTY

 
I am trying to push the build docker image from within pipeline to docker hub and get and error:

==
+ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
Error: Cannot perform an interactive login from a non TTY device
==

The full yml is:
==
pipelines:
branches:
master:
- step:
script:
- echo "$DOCKER_USER_NAME $DOCKER_PASSWORD"
- docker build -t s4ysolutions/spartan-resume-server -f docker/server.Dockerfile .
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker push s4ysolutions/spartan-resume-server
# - docker build -t s4ysolutions/spartan-resume-front -f docker/front.Dockerfile .
#- docker push s4ysolutions/spartan-resume-front
options:
docker: true

 

3 answers

I had exactly the same issue.

then I realized that in another repo it worked. So then I realized 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 example under the "Environment variables" section in the Repository settings, it would raise that confusing docker terminal (tty) error.

Can find the settings probably in this URI: <your_repo_name>/admin/addon/admin/pipelines/repository-variables

Once I fixed that, it worked fine.

I guess you already figured that out :) but for others to come...

I am seeing this issue with the Bitbucket provided bitbucket-piplines.yml docker template.......

Yeah it uses the long param versions when short are required:

change docker login --username xx --password yyy

to

docker login -u xx -p yyy

HI all,  I have exactly the same problem with login. I set DOCKER_LOGIN and DOCKER_PASSWORD under repo settings and for account too. I even left them insecure and still get error

 

 

Screen Shot 2017-11-30 at 21.10.21.png

oh, it should be DOCKER_USER,  sorry, now it worked out !

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,258 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you